diff options
author | job <> | 2023-01-24 09:48:57 +0000 |
---|---|---|
committer | job <> | 2023-01-24 09:48:57 +0000 |
commit | 5eb039b0fc4e1e87f2b77fc8150abd2c9f9f518b (patch) | |
tree | 783f25267b7f2d511ad70c4911a2ec828191aac8 | |
parent | 5e22f6a1f7523e8c3e3bc7b9a4728c17d1623de0 (diff) | |
download | openbsd-5eb039b0fc4e1e87f2b77fc8150abd2c9f9f518b.tar.gz openbsd-5eb039b0fc4e1e87f2b77fc8150abd2c9f9f518b.tar.bz2 openbsd-5eb039b0fc4e1e87f2b77fc8150abd2c9f9f518b.zip |
Check return value of X509_digest
OK tb@
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_crt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c index 79e21d9b92..8655be108e 100644 --- a/src/lib/libcrypto/pkcs12/p12_crt.c +++ b/src/lib/libcrypto/pkcs12/p12_crt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: p12_crt.c,v 1.21 2022/11/12 13:03:28 beck Exp $ */ | 1 | /* $OpenBSD: p12_crt.c,v 1.22 2023/01/24 09:48:57 job Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project. | 3 | * project. |
4 | */ | 4 | */ |
@@ -113,7 +113,8 @@ PKCS12_create(const char *pass, const char *name, EVP_PKEY *pkey, X509 *cert, | |||
113 | if (pkey && cert) { | 113 | if (pkey && cert) { |
114 | if (!X509_check_private_key(cert, pkey)) | 114 | if (!X509_check_private_key(cert, pkey)) |
115 | return NULL; | 115 | return NULL; |
116 | X509_digest(cert, EVP_sha1(), keyid, &keyidlen); | 116 | if (!X509_digest(cert, EVP_sha1(), keyid, &keyidlen)) |
117 | return NULL; | ||
117 | } | 118 | } |
118 | 119 | ||
119 | if (cert) { | 120 | if (cert) { |