diff options
Diffstat (limited to 'src/lib/libcrypto/des/xcbc_enc.c')
-rw-r--r-- | src/lib/libcrypto/des/xcbc_enc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/des/xcbc_enc.c b/src/lib/libcrypto/des/xcbc_enc.c index 47246eb466..dc0c761b71 100644 --- a/src/lib/libcrypto/des/xcbc_enc.c +++ b/src/lib/libcrypto/des/xcbc_enc.c | |||
@@ -60,6 +60,7 @@ | |||
60 | 60 | ||
61 | /* RSA's DESX */ | 61 | /* RSA's DESX */ |
62 | 62 | ||
63 | #if 0 /* broken code, preserved just in case anyone specifically looks for this */ | ||
63 | static unsigned char desx_white_in2out[256]={ | 64 | static unsigned char desx_white_in2out[256]={ |
64 | 0xBD,0x56,0xEA,0xF2,0xA2,0xF1,0xAC,0x2A,0xB0,0x93,0xD1,0x9C,0x1B,0x33,0xFD,0xD0, | 65 | 0xBD,0x56,0xEA,0xF2,0xA2,0xF1,0xAC,0x2A,0xB0,0x93,0xD1,0x9C,0x1B,0x33,0xFD,0xD0, |
65 | 0x30,0x04,0xB6,0xDC,0x7D,0xDF,0x32,0x4B,0xF7,0xCB,0x45,0x9B,0x31,0xBB,0x21,0x5A, | 66 | 0x30,0x04,0xB6,0xDC,0x7D,0xDF,0x32,0x4B,0xF7,0xCB,0x45,0x9B,0x31,0xBB,0x21,0x5A, |
@@ -98,7 +99,7 @@ void DES_xwhite_in2out(const_DES_cblock *des_key, const_DES_cblock *in_white, | |||
98 | } | 99 | } |
99 | 100 | ||
100 | out0=out[0]; | 101 | out0=out[0]; |
101 | out1=out[i]; | 102 | out1=out[i]; /* BUG: out-of-bounds read */ |
102 | for (i=0; i<8; i++) | 103 | for (i=0; i<8; i++) |
103 | { | 104 | { |
104 | out[i]=in[i]^desx_white_in2out[out0^out1]; | 105 | out[i]=in[i]^desx_white_in2out[out0^out1]; |
@@ -106,6 +107,7 @@ void DES_xwhite_in2out(const_DES_cblock *des_key, const_DES_cblock *in_white, | |||
106 | out1=(int)out[i&0x07]; | 107 | out1=(int)out[i&0x07]; |
107 | } | 108 | } |
108 | } | 109 | } |
110 | #endif | ||
109 | 111 | ||
110 | void DES_xcbc_encrypt(const unsigned char *in, unsigned char *out, | 112 | void DES_xcbc_encrypt(const unsigned char *in, unsigned char *out, |
111 | long length, DES_key_schedule *schedule, | 113 | long length, DES_key_schedule *schedule, |