diff common-algo.c @ 715:cd3d3c63d189

Make hmac-sha2-256 and hmac-sha2-512 work
author Matt Johnston <matt@ucc.asn.au>
date Thu, 21 Mar 2013 22:55:12 +0800
parents 983a817f8e41
children 3062da90dab8 b07eb3dc23ec
line wrap: on
line diff
--- a/common-algo.c	Thu Mar 21 21:23:34 2013 +0800
+++ b/common-algo.c	Thu Mar 21 22:55:12 2013 +0800
@@ -45,8 +45,8 @@
 
 /* Mappings for ciphers, parameters are
    {&cipher_desc, keysize, blocksize} */
-/* NOTE: if keysize > 2*SHA1_HASH_SIZE, code such as hashkeys()
-   needs revisiting */
+
+/* Remember to add new ciphers/hashes to regciphers/reghashes too */
 
 #ifdef DROPBEAR_AES256
 static const struct dropbear_cipher dropbear_aes256 = 
@@ -168,10 +168,10 @@
 
 algo_type sshhashes[] = {
 #ifdef DROPBEAR_SHA2_256_HMAC
-//	{"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL},
+	{"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL},
 #endif
 #ifdef DROPBEAR_SHA2_512_HMAC
-//	{"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL},
+	{"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL},
 #endif
 #ifdef DROPBEAR_SHA1_96_HMAC
 	{"hmac-sha1-96", 0, &dropbear_sha1_96, 1, NULL},
@@ -245,6 +245,12 @@
 #ifdef DROPBEAR_MD5_HMAC
 		&md5_desc,
 #endif
+#ifdef DROPBEAR_SHA2_256_HMAC
+		&sha256_desc,
+#endif
+#ifdef DROPBEAR_SHA2_512_HMAC
+		&sha512_desc,
+#endif
 		NULL
 	};	
 	int i;