changeset 1673:e0871128e61f

CBC mode cleanup (#95) * Fix CBC mode can't be fully disabled * Fix CBC mode can't be the only mode
author Vladislav Grishenko <themiron@users.noreply.github.com>
date Mon, 25 May 2020 20:55:13 +0500
parents 3a97f14c0235
children 41bf8f216644
files common-algo.c libtomcrypt/src/headers/tomcrypt_dropbear.h session.h
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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
 
--- 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