Mercurial > dropbear
diff libtomcrypt/src/ciphers/des.c @ 1711:e9dba7abd939
Merge libtomcrypt v1.18.2
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 10 Jun 2020 23:16:13 +0800 |
parents | 1ff2a1034c52 |
children |
line wrap: on
line diff
--- a/libtomcrypt/src/ciphers/des.c Wed Jun 10 23:01:33 2020 +0800 +++ b/libtomcrypt/src/ciphers/des.c Wed Jun 10 23:16:13 2020 +0800 @@ -38,7 +38,7 @@ { "3des", 14, - 24, 24, 8, 16, + 16, 24, 8, 16, &des3_setup, &des3_ecb_encrypt, &des3_ecb_decrypt, @@ -2080,8 +2080,11 @@ int des3_keysize(int *keysize) { LTC_ARGCHK(keysize != NULL); - if(*keysize < 24) { - return CRYPT_INVALID_KEYSIZE; + if (*keysize < 16) + return CRYPT_INVALID_KEYSIZE; + if (*keysize < 24) { + *keysize = 16; + return CRYPT_OK; } *keysize = 24; return CRYPT_OK;