diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/t_req.c')
-rw-r--r-- | src/lib/libcrypto/asn1/t_req.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c index 7df749a48f..bdd749436a 100644 --- a/src/lib/libcrypto/asn1/t_req.c +++ b/src/lib/libcrypto/asn1/t_req.c | |||
@@ -58,15 +58,13 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "buffer.h" | 61 | #include <openssl/buffer.h> |
62 | #include "bn.h" | 62 | #include <openssl/bn.h> |
63 | #include "objects.h" | 63 | #include <openssl/objects.h> |
64 | #include "x509.h" | 64 | #include <openssl/x509.h> |
65 | 65 | ||
66 | #ifndef NO_FP_API | 66 | #ifndef NO_FP_API |
67 | int X509_REQ_print_fp(fp,x) | 67 | int X509_REQ_print_fp(FILE *fp, X509_REQ *x) |
68 | FILE *fp; | ||
69 | X509_REQ *x; | ||
70 | { | 68 | { |
71 | BIO *b; | 69 | BIO *b; |
72 | int ret; | 70 | int ret; |
@@ -83,16 +81,15 @@ X509_REQ *x; | |||
83 | } | 81 | } |
84 | #endif | 82 | #endif |
85 | 83 | ||
86 | int X509_REQ_print(bp,x) | 84 | int X509_REQ_print(BIO *bp, X509_REQ *x) |
87 | BIO *bp; | ||
88 | X509_REQ *x; | ||
89 | { | 85 | { |
90 | unsigned long l; | 86 | unsigned long l; |
91 | int i,n; | 87 | int i,n; |
92 | char *s,*neg; | 88 | char *s; |
89 | const char *neg; | ||
93 | X509_REQ_INFO *ri; | 90 | X509_REQ_INFO *ri; |
94 | EVP_PKEY *pkey; | 91 | EVP_PKEY *pkey; |
95 | STACK *sk; | 92 | STACK_OF(X509_ATTRIBUTE) *sk; |
96 | char str[128]; | 93 | char str[128]; |
97 | 94 | ||
98 | ri=x->req_info; | 95 | ri=x->req_info; |
@@ -138,12 +135,14 @@ X509_REQ *x; | |||
138 | #endif | 135 | #endif |
139 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); | 136 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); |
140 | 137 | ||
138 | EVP_PKEY_free(pkey); | ||
139 | |||
141 | /* may not be */ | 140 | /* may not be */ |
142 | sprintf(str,"%8sAttributes:\n",""); | 141 | sprintf(str,"%8sAttributes:\n",""); |
143 | if (BIO_puts(bp,str) <= 0) goto err; | 142 | if (BIO_puts(bp,str) <= 0) goto err; |
144 | 143 | ||
145 | sk=x->req_info->attributes; | 144 | sk=x->req_info->attributes; |
146 | if ((sk == NULL) || (sk_num(sk) == 0)) | 145 | if ((sk == NULL) || (sk_X509_ATTRIBUTE_num(sk) == 0)) |
147 | { | 146 | { |
148 | if (!x->req_info->req_kludge) | 147 | if (!x->req_info->req_kludge) |
149 | { | 148 | { |
@@ -153,7 +152,7 @@ X509_REQ *x; | |||
153 | } | 152 | } |
154 | else | 153 | else |
155 | { | 154 | { |
156 | for (i=0; i<sk_num(sk); i++) | 155 | for (i=0; i<sk_X509_ATTRIBUTE_num(sk); i++) |
157 | { | 156 | { |
158 | ASN1_TYPE *at; | 157 | ASN1_TYPE *at; |
159 | X509_ATTRIBUTE *a; | 158 | X509_ATTRIBUTE *a; |
@@ -161,17 +160,17 @@ X509_REQ *x; | |||
161 | ASN1_TYPE *t; | 160 | ASN1_TYPE *t; |
162 | int j,type=0,count=1,ii=0; | 161 | int j,type=0,count=1,ii=0; |
163 | 162 | ||
164 | a=(X509_ATTRIBUTE *)sk_value(sk,i); | 163 | a=sk_X509_ATTRIBUTE_value(sk,i); |
165 | sprintf(str,"%12s",""); | 164 | sprintf(str,"%12s",""); |
166 | if (BIO_puts(bp,str) <= 0) goto err; | 165 | if (BIO_puts(bp,str) <= 0) goto err; |
167 | if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0) | 166 | if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0) |
168 | 167 | { | |
169 | if (a->set) | 168 | if (a->set) |
170 | { | 169 | { |
171 | ii=0; | 170 | ii=0; |
172 | count=sk_num(a->value.set); | 171 | count=sk_ASN1_TYPE_num(a->value.set); |
173 | get_next: | 172 | get_next: |
174 | at=(ASN1_TYPE *)sk_value(a->value.set,ii); | 173 | at=sk_ASN1_TYPE_value(a->value.set,ii); |
175 | type=at->type; | 174 | type=at->type; |
176 | bs=at->value.asn1_string; | 175 | bs=at->value.asn1_string; |
177 | } | 176 | } |
@@ -181,6 +180,7 @@ get_next: | |||
181 | type=t->type; | 180 | type=t->type; |
182 | bs=t->value.bit_string; | 181 | bs=t->value.bit_string; |
183 | } | 182 | } |
183 | } | ||
184 | for (j=25-j; j>0; j--) | 184 | for (j=25-j; j>0; j--) |
185 | if (BIO_write(bp," ",1) != 1) goto err; | 185 | if (BIO_write(bp," ",1) != 1) goto err; |
186 | if (BIO_puts(bp,":") <= 0) goto err; | 186 | if (BIO_puts(bp,":") <= 0) goto err; |