# HG changeset patch # User Vladislav Grishenko # Date 1590422113 -18000 # Node ID e0871128e61fb9a734586e3580103bab00c5aa03 # Parent 3a97f14c02351a08917126998e1da61826ca3746 CBC mode cleanup (#95) * Fix CBC mode can't be fully disabled * Fix CBC mode can't be the only mode diff -r 3a97f14c0235 -r e0871128e61f common-algo.c --- a/common-algo.c Mon May 25 20:50:25 2020 +0500 +++ b/common-algo.c Mon May 25 20:55:13 2020 +0500 @@ -184,12 +184,18 @@ #if DROPBEAR_TWOFISH128 {"twofish128-cbc", 0, &dropbear_twofish128, 1, &dropbear_mode_cbc}, #endif +#endif /* DROPBEAR_ENABLE_CBC_MODE */ + #if DROPBEAR_3DES +#if DROPBEAR_ENABLE_CTR_MODE {"3des-ctr", 0, &dropbear_3des, 1, &dropbear_mode_ctr}, #endif -#if DROPBEAR_3DES +#if DROPBEAR_ENABLE_CBC_MODE {"3des-cbc", 0, &dropbear_3des, 1, &dropbear_mode_cbc}, #endif +#endif /* DROPBEAR_3DES */ + +#if DROPBEAR_ENABLE_CBC_MODE #if DROPBEAR_BLOWFISH {"blowfish-cbc", 0, &dropbear_blowfish, 1, &dropbear_mode_cbc}, #endif diff -r 3a97f14c0235 -r e0871128e61f libtomcrypt/src/headers/tomcrypt_dropbear.h --- a/libtomcrypt/src/headers/tomcrypt_dropbear.h Mon May 25 20:50:25 2020 +0500 +++ b/libtomcrypt/src/headers/tomcrypt_dropbear.h Mon May 25 20:55:13 2020 +0500 @@ -27,7 +27,7 @@ #define LTC_DES #endif -#if DROPBEAR_ENABLE_CTR_MODE +#if DROPBEAR_ENABLE_CBC_MODE #define LTC_CBC_MODE #endif diff -r 3a97f14c0235 -r e0871128e61f session.h --- a/session.h Mon May 25 20:50:25 2020 +0500 +++ b/session.h Mon May 25 20:55:13 2020 +0500 @@ -79,7 +79,9 @@ #endif /* actual keys */ union { +#if DROPBEAR_ENABLE_CBC_MODE symmetric_CBC cbc; +#endif #if DROPBEAR_ENABLE_CTR_MODE symmetric_CTR ctr; #endif