diff options
Diffstat (limited to 'crypto/des/set_key.c')
-rw-r--r-- | crypto/des/set_key.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index c0806d5..d3e69ca 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -64,12 +64,10 @@ * 1.0 First working version */ #include "des_locl.h" -#ifdef OPENSSL_FIPS -#include <openssl/fips.h> -#endif +#include <openssl/crypto.h> -OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */ +OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */ static const unsigned char odd_parity[256]={ 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14, @@ -339,8 +337,15 @@ int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule) } void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) +#ifdef OPENSSL_FIPS + { + fips_cipher_abort(DES); + private_DES_set_key_unchecked(key, schedule); + } +void private_DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) +#endif { - static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; + static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; register DES_LONG c,d,t,s,t2; register const unsigned char *in; register DES_LONG *k; @@ -353,10 +358,6 @@ void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) k = &schedule->ks->deslong[0]; in = &(*key)[0]; -#ifdef OPENSSL_FIPS - FIPS_selftest_check(); -#endif - c2l(in,c); c2l(in,d); @@ -413,4 +414,3 @@ void des_fixup_key_parity(des_cblock *key) des_set_odd_parity(key); } */ - |