diff options
author | beck <> | 2000-04-15 06:18:51 +0000 |
---|---|---|
committer | beck <> | 2000-04-15 06:18:51 +0000 |
commit | b608c7f2b175e121f2c22d53341a317153afdc8e (patch) | |
tree | e94b160b3fcd8180df79e4251d68d24d665f0195 /src/lib/libcrypto/evp | |
parent | c8d6701c396cebdcd0d45eac73b762e9498f6b01 (diff) | |
download | openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.tar.gz openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.tar.bz2 openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.zip |
OpenSSL 0.9.5a merge
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r-- | src/lib/libcrypto/evp/evp_err.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp_pkey.c | 14 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/names.c | 5 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/evp_err.c b/src/lib/libcrypto/evp/evp_err.c index 97953a0fc1..fc149cbb1a 100644 --- a/src/lib/libcrypto/evp/evp_err.c +++ b/src/lib/libcrypto/evp/evp_err.c | |||
@@ -54,7 +54,8 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
57 | * made to it will be overwritten when the script next updates this file. | 57 | * made to it will be overwritten when the script next updates this file, |
58 | * only reason strings will be preserved. | ||
58 | */ | 59 | */ |
59 | 60 | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c index d5e6f5880f..4ab091fa56 100644 --- a/src/lib/libcrypto/evp/evp_pkey.c +++ b/src/lib/libcrypto/evp/evp_pkey.c | |||
@@ -133,7 +133,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
133 | * SEQUENCE {parameters, priv_key} | 133 | * SEQUENCE {parameters, priv_key} |
134 | * SEQUENCE {pub_key, priv_key} | 134 | * SEQUENCE {pub_key, priv_key} |
135 | */ | 135 | */ |
136 | 136 | ||
137 | t1 = (ASN1_TYPE *)sk_value(ndsa, 0); | 137 | t1 = (ASN1_TYPE *)sk_value(ndsa, 0); |
138 | t2 = (ASN1_TYPE *)sk_value(ndsa, 1); | 138 | t2 = (ASN1_TYPE *)sk_value(ndsa, 1); |
139 | if(t1->type == V_ASN1_SEQUENCE) { | 139 | if(t1->type == V_ASN1_SEQUENCE) { |
@@ -152,7 +152,14 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
152 | goto dsaerr; | 152 | goto dsaerr; |
153 | } | 153 | } |
154 | privkey = t2->value.integer; | 154 | privkey = t2->value.integer; |
155 | } else if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) { | 155 | } else { |
156 | if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) { | ||
157 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | ||
158 | goto dsaerr; | ||
159 | } | ||
160 | param = p8->pkeyalg->parameter; | ||
161 | } | ||
162 | if (!param || (param->type != V_ASN1_SEQUENCE)) { | ||
156 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); | 163 | EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); |
157 | goto dsaerr; | 164 | goto dsaerr; |
158 | } | 165 | } |
@@ -186,7 +193,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) | |||
186 | 193 | ||
187 | EVP_PKEY_assign_DSA(pkey, dsa); | 194 | EVP_PKEY_assign_DSA(pkey, dsa); |
188 | BN_CTX_free (ctx); | 195 | BN_CTX_free (ctx); |
189 | sk_pop_free(ndsa, ASN1_TYPE_free); | 196 | if(ndsa) sk_pop_free(ndsa, ASN1_TYPE_free); |
197 | else ASN1_INTEGER_free(privkey); | ||
190 | break; | 198 | break; |
191 | dsaerr: | 199 | dsaerr: |
192 | BN_CTX_free (ctx); | 200 | BN_CTX_free (ctx); |
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c index 3e8f460328..620f43feaa 100644 --- a/src/lib/libcrypto/evp/names.c +++ b/src/lib/libcrypto/evp/names.c | |||
@@ -114,5 +114,10 @@ void EVP_cleanup(void) | |||
114 | { | 114 | { |
115 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH); | 115 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH); |
116 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH); | 116 | OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH); |
117 | /* The above calls will only clean out the contents of the name | ||
118 | hash table, but not the hash table itself. The following line | ||
119 | does that part. -- Richard Levitte */ | ||
120 | OBJ_NAME_cleanup(-1); | ||
121 | |||
117 | EVP_PBE_cleanup(); | 122 | EVP_PBE_cleanup(); |
118 | } | 123 | } |