diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-04-14 11:15:10 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-04-14 11:15:10 +0000 |
commit | ac892b7aa6532e0345e430208335403ead5d2de1 (patch) | |
tree | 00f6a544791b74740dbfe115ac6fc7fd4d465de5 /fips/sha | |
parent | 77394d7e8f2ca8ca01cfe9b002e3df62ae34a23b (diff) | |
download | openssl-ac892b7aa6532e0345e430208335403ead5d2de1.tar.gz |
Initial incomplete POST overhaul: add support for POST callback to
allow status of POST to be monitored and/or failures induced.
Diffstat (limited to 'fips/sha')
-rw-r--r-- | fips/sha/fips_sha1_selftest.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/fips/sha/fips_sha1_selftest.c b/fips/sha/fips_sha1_selftest.c index 3a4b4315c5..e0f0c12d9e 100644 --- a/fips/sha/fips_sha1_selftest.c +++ b/fips/sha/fips_sha1_selftest.c @@ -56,7 +56,7 @@ #include <openssl/sha.h> #ifdef OPENSSL_FIPS -static char test[][60]= +static unsigned char test[][60]= { "", "abc", @@ -79,21 +79,20 @@ void FIPS_corrupt_sha1() } int FIPS_selftest_sha1() - { - size_t n; - - for(n=0 ; n<sizeof(test)/sizeof(test[0]) ; ++n) { - unsigned char md[SHA_DIGEST_LENGTH]; - - FIPS_digest(test[n],strlen(test[n]),md, NULL, EVP_sha1()); - if(memcmp(md,ret[n],sizeof md)) - { - FIPSerr(FIPS_F_FIPS_SELFTEST_SHA1,FIPS_R_SELFTEST_FAILED); - return 0; - } - } - return 1; - } + int rv = 1; + size_t i; + + for(i=0 ; i <sizeof(test)/sizeof(test[0]) ; i++) + { + if (!fips_pkey_signature_test(FIPS_TEST_DIGEST, NULL, + test[i], 0, + ret[i], 20, + EVP_sha1(), 0, + "SHA1 Digest")) + rv = 0; + } + return rv; + } #endif |