summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/set_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/set_key.c')
-rw-r--r--src/lib/libcrypto/des/set_key.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libcrypto/des/set_key.c b/src/lib/libcrypto/des/set_key.c
index a43ef3c881..8881d46a7a 100644
--- a/src/lib/libcrypto/des/set_key.c
+++ b/src/lib/libcrypto/des/set_key.c
@@ -65,6 +65,8 @@
65 */ 65 */
66#include "des_locl.h" 66#include "des_locl.h"
67 67
68#ifndef OPENSSL_FIPS
69
68OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */ 70OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key); /* defaults to false */
69 71
70static const unsigned char odd_parity[256]={ 72static const unsigned char odd_parity[256]={
@@ -87,7 +89,7 @@ static const unsigned char odd_parity[256]={
87 89
88void DES_set_odd_parity(DES_cblock *key) 90void DES_set_odd_parity(DES_cblock *key)
89 { 91 {
90 unsigned int i; 92 int i;
91 93
92 for (i=0; i<DES_KEY_SZ; i++) 94 for (i=0; i<DES_KEY_SZ; i++)
93 (*key)[i]=odd_parity[(*key)[i]]; 95 (*key)[i]=odd_parity[(*key)[i]];
@@ -95,7 +97,7 @@ void DES_set_odd_parity(DES_cblock *key)
95 97
96int DES_check_key_parity(const_DES_cblock *key) 98int DES_check_key_parity(const_DES_cblock *key)
97 { 99 {
98 unsigned int i; 100 int i;
99 101
100 for (i=0; i<DES_KEY_SZ; i++) 102 for (i=0; i<DES_KEY_SZ; i++)
101 { 103 {
@@ -115,7 +117,7 @@ int DES_check_key_parity(const_DES_cblock *key)
115 * (and actual cblock values). 117 * (and actual cblock values).
116 */ 118 */
117#define NUM_WEAK_KEY 16 119#define NUM_WEAK_KEY 16
118static const DES_cblock weak_keys[NUM_WEAK_KEY]={ 120static DES_cblock weak_keys[NUM_WEAK_KEY]={
119 /* weak keys */ 121 /* weak keys */
120 {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01}, 122 {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
121 {0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE}, 123 {0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE},
@@ -405,3 +407,5 @@ void des_fixup_key_parity(des_cblock *key)
405 des_set_odd_parity(key); 407 des_set_odd_parity(key);
406 } 408 }
407*/ 409*/
410
411#endif /* ndef OPENSSL_FIPS */