diff options
author | beck <> | 1999-09-29 04:37:45 +0000 |
---|---|---|
committer | beck <> | 1999-09-29 04:37:45 +0000 |
commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/x509/x509_r2x.c | |
parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip |
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/x509/x509_r2x.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_r2x.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/lib/libcrypto/x509/x509_r2x.c b/src/lib/libcrypto/x509/x509_r2x.c index 6aec2427f7..bb4697ae60 100644 --- a/src/lib/libcrypto/x509/x509_r2x.c +++ b/src/lib/libcrypto/x509/x509_r2x.c | |||
@@ -58,22 +58,16 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "bn.h" | 61 | #include <openssl/bn.h> |
62 | #include "evp.h" | 62 | #include <openssl/evp.h> |
63 | #include "asn1.h" | 63 | #include <openssl/asn1.h> |
64 | #include "x509.h" | 64 | #include <openssl/x509.h> |
65 | #include "objects.h" | 65 | #include <openssl/objects.h> |
66 | #include "buffer.h" | 66 | #include <openssl/buffer.h> |
67 | #include "pem.h" | ||
68 | 67 | ||
69 | X509 *X509_REQ_to_X509(r,days,pkey) | 68 | X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) |
70 | X509_REQ *r; | ||
71 | int days; | ||
72 | EVP_PKEY *pkey; | ||
73 | { | 69 | { |
74 | X509 *ret=NULL; | 70 | X509 *ret=NULL; |
75 | int er=1; | ||
76 | X509_REQ_INFO *ri=NULL; | ||
77 | X509_CINF *xi=NULL; | 71 | X509_CINF *xi=NULL; |
78 | X509_NAME *xn; | 72 | X509_NAME *xn; |
79 | 73 | ||
@@ -84,13 +78,9 @@ EVP_PKEY *pkey; | |||
84 | } | 78 | } |
85 | 79 | ||
86 | /* duplicate the request */ | 80 | /* duplicate the request */ |
87 | ri=(X509_REQ_INFO *)ASN1_dup(i2d_X509_REQ_INFO, | ||
88 | (char *(*)())d2i_X509_REQ_INFO,(char *)r->req_info); | ||
89 | if (ri == NULL) goto err; | ||
90 | |||
91 | xi=ret->cert_info; | 81 | xi=ret->cert_info; |
92 | 82 | ||
93 | if (sk_num(ri->attributes) != 0) | 83 | if (sk_X509_ATTRIBUTE_num(r->req_info->attributes) != 0) |
94 | { | 84 | { |
95 | if ((xi->version=ASN1_INTEGER_new()) == NULL) goto err; | 85 | if ((xi->version=ASN1_INTEGER_new()) == NULL) goto err; |
96 | if (!ASN1_INTEGER_set(xi->version,2)) goto err; | 86 | if (!ASN1_INTEGER_set(xi->version,2)) goto err; |
@@ -109,13 +99,11 @@ EVP_PKEY *pkey; | |||
109 | 99 | ||
110 | if (!X509_sign(ret,pkey,EVP_md5())) | 100 | if (!X509_sign(ret,pkey,EVP_md5())) |
111 | goto err; | 101 | goto err; |
112 | er=0; | 102 | if (0) |
113 | err: | ||
114 | if (er) | ||
115 | { | 103 | { |
104 | err: | ||
116 | X509_free(ret); | 105 | X509_free(ret); |
117 | X509_REQ_INFO_free(ri); | 106 | ret=NULL; |
118 | return(NULL); | ||
119 | } | 107 | } |
120 | return(ret); | 108 | return(ret); |
121 | } | 109 | } |