summaryrefslogtreecommitdiff
path: root/fips/dsa
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-05-06 17:38:39 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-05-06 17:38:39 +0000
commitad4784953d6d79484204a8bb8243be73a6e9aa98 (patch)
tree1e58ec0ced9a3013f2ab517a667d5e5fb581d309 /fips/dsa
parent6b7be581e52761b2a0dc5dcf35214ff813b9f9f0 (diff)
downloadopenssl-new-ad4784953d6d79484204a8bb8243be73a6e9aa98.tar.gz
Return error codes for selftest failure instead of hard assertion errors.
Diffstat (limited to 'fips/dsa')
-rw-r--r--fips/dsa/fips_dsa_sign.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fips/dsa/fips_dsa_sign.c b/fips/dsa/fips_dsa_sign.c
index 16689309b9..ea1bd87303 100644
--- a/fips/dsa/fips_dsa_sign.c
+++ b/fips/dsa/fips_dsa_sign.c
@@ -3,7 +3,7 @@
* project 2007.
*/
/* ====================================================================
- * Copyright (c) 2007 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 2011 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -84,7 +84,11 @@ DSA_SIG * FIPS_dsa_sign_ctx(DSA *dsa, EVP_MD_CTX *ctx)
DSA_SIG * FIPS_dsa_sign_digest(DSA *dsa, const unsigned char *dig, int dlen)
{
- FIPS_selftest_check();
+ if (FIPS_selftest_failed())
+ {
+ FIPSerr(FIPS_F_FIPS_DSA_SIGN_DIGEST, FIPS_R_SELFTEST_FAILED);
+ return NULL;
+ }
return dsa->meth->dsa_do_sign(dig, dlen, dsa);
}
@@ -102,7 +106,11 @@ int FIPS_dsa_verify_ctx(DSA *dsa, EVP_MD_CTX *ctx, DSA_SIG *s)
int FIPS_dsa_verify_digest(DSA *dsa,
const unsigned char *dig, int dlen, DSA_SIG *s)
{
- FIPS_selftest_check();
+ if (FIPS_selftest_failed())
+ {
+ FIPSerr(FIPS_F_FIPS_DSA_VERIFY_DIGEST, FIPS_R_SELFTEST_FAILED);
+ return -1;
+ }
return dsa->meth->dsa_do_verify(dig,dlen,s,dsa);
}