X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=fips%2Ffips_post.c;h=5a002db7da1d9b18552664207781c406724250bf;hb=0f817d3b2705f315f4c8c22b5dfee0218848f37a;hp=1ab156fb3f4f9487c02400341542f6990263a0a9;hpb=ac892b7aa6532e0345e430208335403ead5d2de1;p=oweals%2Fopenssl.git diff --git a/fips/fips_post.c b/fips/fips_post.c index 1ab156fb3f..5a002db7da 100644 --- a/fips/fips_post.c +++ b/fips/fips_post.c @@ -105,12 +105,14 @@ void fips_post_end(void) if (post_failure) { post_status = FIPS_POST_STATUS_FAILED; - fips_post_cb(FIPS_POST_END, 0, 0, NULL); + if(fips_post_cb) + fips_post_cb(FIPS_POST_END, 0, 0, NULL); } else { post_status = FIPS_POST_STATUS_OK; - fips_post_cb(FIPS_POST_END, 1, 0, NULL); + if (fips_post_cb) + fips_post_cb(FIPS_POST_END, 1, 0, NULL); } } @@ -170,8 +172,12 @@ int FIPS_selftest(void) rv = 0; if (!FIPS_selftest_aes()) rv = 0; + if (!FIPS_selftest_aes_ccm()) + rv = 0; if (!FIPS_selftest_aes_gcm()) rv = 0; + if (!FIPS_selftest_aes_xts()) + rv = 0; if (!FIPS_selftest_des()) rv = 0; if (!FIPS_selftest_rsa()) @@ -180,6 +186,8 @@ int FIPS_selftest(void) rv = 0; if (!FIPS_selftest_dsa()) rv = 0; + if (!FIPS_selftest_ecdh()) + rv = 0; fips_post_end(); return rv; } @@ -199,10 +207,10 @@ int fips_pkey_signature_test(int id, EVP_PKEY *pkey, const char *fail_str) { int subid; - void *ex = NULL; int ret = 0; unsigned char *sig = NULL; unsigned int siglen; + __fips_constseg static const unsigned char str1[]="12345678901234567890"; DSA_SIG *dsig = NULL; ECDSA_SIG *esig = NULL; @@ -292,7 +300,7 @@ int fips_pkey_signature_test(int id, EVP_PKEY *pkey, if (pkey == NULL) { ret = 1; - /* Well actually sucess as we've set ret to 1 */ + /* Well actually success as we've set ret to 1 */ goto error; } if (!FIPS_digestinit(&mctx, digest)) @@ -326,7 +334,7 @@ int fips_pkey_signature_test(int id, EVP_PKEY *pkey, FIPSerr(FIPS_F_FIPS_PKEY_SIGNATURE_TEST,FIPS_R_TEST_FAILURE); if (fail_str) FIPS_add_error_data(2, "Type=", fail_str); - fips_post_failed(id, subid, ex); + fips_post_failed(id, subid, pkey); return 0; } return fips_post_success(id, subid, pkey);