diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_kiss.c')
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_kiss.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c index 885087ad00..2b31999e11 100644 --- a/src/lib/libcrypto/pkcs12/p12_kiss.c +++ b/src/lib/libcrypto/pkcs12/p12_kiss.c | |||
@@ -249,14 +249,26 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, | |||
249 | if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate ) | 249 | if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate ) |
250 | return 1; | 250 | return 1; |
251 | if (!(x509 = PKCS12_certbag2x509(bag))) return 0; | 251 | if (!(x509 = PKCS12_certbag2x509(bag))) return 0; |
252 | if(ckid) X509_keyid_set1(x509, ckid->data, ckid->length); | 252 | if(ckid) |
253 | { | ||
254 | if (!X509_keyid_set1(x509, ckid->data, ckid->length)) | ||
255 | { | ||
256 | X509_free(x509); | ||
257 | return 0; | ||
258 | } | ||
259 | } | ||
253 | if(fname) { | 260 | if(fname) { |
254 | int len; | 261 | int len, r; |
255 | unsigned char *data; | 262 | unsigned char *data; |
256 | len = ASN1_STRING_to_UTF8(&data, fname); | 263 | len = ASN1_STRING_to_UTF8(&data, fname); |
257 | if(len > 0) { | 264 | if(len > 0) { |
258 | X509_alias_set1(x509, data, len); | 265 | r = X509_alias_set1(x509, data, len); |
259 | OPENSSL_free(data); | 266 | OPENSSL_free(data); |
267 | if (!r) | ||
268 | { | ||
269 | X509_free(x509); | ||
270 | return 0; | ||
271 | } | ||
260 | } | 272 | } |
261 | } | 273 | } |
262 | 274 | ||