diff options
Diffstat (limited to 'src/lib/libcrypto/cast/c_skey.c')
| -rw-r--r-- | src/lib/libcrypto/cast/c_skey.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cast/c_skey.c b/src/lib/libcrypto/cast/c_skey.c index 2fc3363dcd..76e40005c9 100644 --- a/src/lib/libcrypto/cast/c_skey.c +++ b/src/lib/libcrypto/cast/c_skey.c | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include "cast.h" | 59 | #include <openssl/cast.h> |
| 60 | #include "cast_lcl.h" | 60 | #include "cast_lcl.h" |
| 61 | #include "cast_s.h" | 61 | #include "cast_s.h" |
| 62 | 62 | ||
| @@ -72,10 +72,7 @@ | |||
| 72 | #define S6 CAST_S_table6 | 72 | #define S6 CAST_S_table6 |
| 73 | #define S7 CAST_S_table7 | 73 | #define S7 CAST_S_table7 |
| 74 | 74 | ||
| 75 | void CAST_set_key(key,len,data) | 75 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data) |
| 76 | CAST_KEY *key; | ||
| 77 | int len; | ||
| 78 | unsigned char *data; | ||
| 79 | { | 76 | { |
| 80 | CAST_LONG x[16]; | 77 | CAST_LONG x[16]; |
| 81 | CAST_LONG z[16]; | 78 | CAST_LONG z[16]; |
| @@ -88,6 +85,10 @@ unsigned char *data; | |||
| 88 | if (len > 16) len=16; | 85 | if (len > 16) len=16; |
| 89 | for (i=0; i<len; i++) | 86 | for (i=0; i<len; i++) |
| 90 | x[i]=data[i]; | 87 | x[i]=data[i]; |
| 88 | if(len <= 10) | ||
| 89 | key->short_key=1; | ||
| 90 | else | ||
| 91 | key->short_key=0; | ||
| 91 | 92 | ||
| 92 | K= &k[0]; | 93 | K= &k[0]; |
| 93 | X[0]=((x[ 0]<<24)|(x[ 1]<<16)|(x[ 2]<<8)|x[ 3])&0xffffffffL; | 94 | X[0]=((x[ 0]<<24)|(x[ 1]<<16)|(x[ 2]<<8)|x[ 3])&0xffffffffL; |
