summaryrefslogtreecommitdiffstats
path: root/crypto/dsa
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2023-03-01 12:22:49 +1100
committerPauli <pauli@openssl.org>2023-03-03 10:10:22 +1100
commitdd573a2fc1e8806c67420a5d6df0de175745aaf8 (patch)
tree1069067223211973c8d56f25cc83b6486789cc32 /crypto/dsa
parente8ca529feb0d062ab9f869ac25a37cc4c6b8b329 (diff)
Coverity 1521557: Error handling issues
Check the return from DSA_set0_key and generate an error on failure. Technically a false positive since the function always returns success. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/20409)
Diffstat (limited to 'crypto/dsa')
-rw-r--r--crypto/dsa/dsa_backend.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/dsa/dsa_backend.c b/crypto/dsa/dsa_backend.c
index 924ccbdc0b..ceaf6e6877 100644
--- a/crypto/dsa/dsa_backend.c
+++ b/crypto/dsa/dsa_backend.c
@@ -173,7 +173,10 @@ DSA *ossl_dsa_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
ERR_raise(ERR_LIB_DSA, DSA_R_BN_ERROR);
goto dsaerr;
}
- DSA_set0_key(dsa, dsa_pubkey, dsa_privkey);
+ if (!DSA_set0_key(dsa, dsa_pubkey, dsa_privkey)) {
+ ERR_raise(ERR_LIB_DSA, ERR_R_INTERNAL_ERROR);
+ goto dsaerr;
+ }
goto done;