diff options
Diffstat (limited to 'crypto/des')
-rw-r--r-- | crypto/des/des.h | 3 | ||||
-rw-r--r-- | crypto/des/set_key.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/crypto/des/des.h b/crypto/des/des.h index 92b6663599..1eaedcbd24 100644 --- a/crypto/des/des.h +++ b/crypto/des/des.h @@ -224,6 +224,9 @@ int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule); int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule); 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 +void private_DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); +#endif void DES_string_to_key(const char *str,DES_cblock *key); void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2); void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length, diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index 3004cc3ab3..d3e69ca8b5 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -65,6 +65,8 @@ */ #include "des_locl.h" +#include <openssl/crypto.h> + OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */ static const unsigned char odd_parity[256]={ @@ -335,6 +337,13 @@ 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 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; |