summaryrefslogtreecommitdiffstats
path: root/crypto/dsa
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-09-10 14:01:30 +1000
committerPauli <paul.dale@oracle.com>2020-09-12 16:46:51 +1000
commit35e6ea3bdc2741c1818337e75756b45d6a2a6122 (patch)
tree5e3220d285fb8cbc899c7e7565475c832c00943e /crypto/dsa
parent801ed9edbad11b3f0646b396c672dbae33353de2 (diff)
keygen: add FIPS error state management to conditional self tests
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12801)
Diffstat (limited to 'crypto/dsa')
-rw-r--r--crypto/dsa/dsa_key.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c
index b537ec0b3c..bf9d8a269c 100644
--- a/crypto/dsa/dsa_key.c
+++ b/crypto/dsa/dsa_key.c
@@ -18,6 +18,7 @@
#include "internal/cryptlib.h"
#include <openssl/bn.h>
#include <openssl/self_test.h>
+#include "prov/providercommon.h"
#include "crypto/dsa.h"
#include "dsa_local.h"
@@ -113,6 +114,7 @@ static int dsa_keygen(DSA *dsa, int pairwise_test)
OSSL_SELF_TEST_get_callback(dsa->libctx, &cb, &cbarg);
ok = dsa_keygen_pairwise_test(dsa, cb, cbarg);
if (!ok) {
+ ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
BN_free(dsa->pub_key);
BN_clear_free(dsa->priv_key);
dsa->pub_key = NULL;