diff options
author | beck <> | 2000-03-19 11:13:58 +0000 |
---|---|---|
committer | beck <> | 2000-03-19 11:13:58 +0000 |
commit | 796d609550df3a33fc11468741c5d2f6d3df4c11 (patch) | |
tree | 6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/x509v3/v3_skey.c | |
parent | 5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff) | |
download | openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2 openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip |
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2
if you are using the ssl26 packages for ssh and other things to work you will
need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_skey.c')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_skey.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_skey.c b/src/lib/libcrypto/x509v3/v3_skey.c index fb3e36014d..939845fa8f 100644 --- a/src/lib/libcrypto/x509v3/v3_skey.c +++ b/src/lib/libcrypto/x509v3/v3_skey.c | |||
@@ -61,24 +61,17 @@ | |||
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/x509v3.h> | 62 | #include <openssl/x509v3.h> |
63 | 63 | ||
64 | static ASN1_OCTET_STRING *octet_string_new(void); | ||
65 | static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); | 64 | static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); |
66 | X509V3_EXT_METHOD v3_skey_id = { | 65 | X509V3_EXT_METHOD v3_skey_id = { |
67 | NID_subject_key_identifier, 0, | 66 | NID_subject_key_identifier, 0, |
68 | (X509V3_EXT_NEW)octet_string_new, | 67 | (X509V3_EXT_NEW)ASN1_OCTET_STRING_new, |
69 | (X509V3_EXT_FREE)ASN1_STRING_free, | 68 | (X509V3_EXT_FREE)ASN1_OCTET_STRING_free, |
70 | (X509V3_EXT_D2I)d2i_ASN1_OCTET_STRING, | 69 | (X509V3_EXT_D2I)d2i_ASN1_OCTET_STRING, |
71 | (X509V3_EXT_I2D)i2d_ASN1_OCTET_STRING, | 70 | (X509V3_EXT_I2D)i2d_ASN1_OCTET_STRING, |
72 | (X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING, | 71 | (X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING, |
73 | (X509V3_EXT_S2I)s2i_skey_id, | 72 | (X509V3_EXT_S2I)s2i_skey_id, |
74 | NULL, NULL, NULL, NULL, NULL}; | 73 | NULL, NULL, NULL, NULL, NULL}; |
75 | 74 | ||
76 | |||
77 | static ASN1_OCTET_STRING *octet_string_new(void) | ||
78 | { | ||
79 | return ASN1_OCTET_STRING_new(); | ||
80 | } | ||
81 | |||
82 | char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, | 75 | char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, |
83 | ASN1_OCTET_STRING *oct) | 76 | ASN1_OCTET_STRING *oct) |
84 | { | 77 | { |
@@ -91,13 +84,13 @@ ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, | |||
91 | ASN1_OCTET_STRING *oct; | 84 | ASN1_OCTET_STRING *oct; |
92 | long length; | 85 | long length; |
93 | 86 | ||
94 | if(!(oct = ASN1_OCTET_STRING_new())) { | 87 | if(!(oct = M_ASN1_OCTET_STRING_new())) { |
95 | X509V3err(X509V3_F_S2I_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE); | 88 | X509V3err(X509V3_F_S2I_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE); |
96 | return NULL; | 89 | return NULL; |
97 | } | 90 | } |
98 | 91 | ||
99 | if(!(oct->data = string_to_hex(str, &length))) { | 92 | if(!(oct->data = string_to_hex(str, &length))) { |
100 | ASN1_OCTET_STRING_free(oct); | 93 | M_ASN1_OCTET_STRING_free(oct); |
101 | return NULL; | 94 | return NULL; |
102 | } | 95 | } |
103 | 96 | ||
@@ -118,7 +111,7 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, | |||
118 | 111 | ||
119 | if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str); | 112 | if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str); |
120 | 113 | ||
121 | if(!(oct = ASN1_OCTET_STRING_new())) { | 114 | if(!(oct = M_ASN1_OCTET_STRING_new())) { |
122 | X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); | 115 | X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); |
123 | return NULL; | 116 | return NULL; |
124 | } | 117 | } |
@@ -143,7 +136,7 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, | |||
143 | EVP_DigestUpdate(&md, pk->data, pk->length); | 136 | EVP_DigestUpdate(&md, pk->data, pk->length); |
144 | EVP_DigestFinal(&md, pkey_dig, &diglen); | 137 | EVP_DigestFinal(&md, pkey_dig, &diglen); |
145 | 138 | ||
146 | if(!ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { | 139 | if(!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { |
147 | X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); | 140 | X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); |
148 | goto err; | 141 | goto err; |
149 | } | 142 | } |
@@ -151,6 +144,6 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, | |||
151 | return oct; | 144 | return oct; |
152 | 145 | ||
153 | err: | 146 | err: |
154 | ASN1_OCTET_STRING_free(oct); | 147 | M_ASN1_OCTET_STRING_free(oct); |
155 | return NULL; | 148 | return NULL; |
156 | } | 149 | } |