diff common-algo.c @ 679:03073a27abb3 sha2

- Add hmac-sha2-256 and hmac-sha2-512. Needs debugging, seems to be getting keyed incorrectly
author Matt Johnston <matt@ucc.asn.au>
date Thu, 10 May 2012 08:38:37 +0800
parents 2895626d864f
children a4b7627b3157
line wrap: on
line diff
--- a/common-algo.c	Wed May 09 22:52:58 2012 +0800
+++ b/common-algo.c	Thu May 10 08:38:37 2012 +0800
@@ -106,6 +106,14 @@
 static const struct dropbear_hash dropbear_sha1_96 = 
 	{&sha1_desc, 20, 12};
 #endif
+#ifdef DROPBEAR_SHA2_256_HMAC
+static const struct dropbear_hash dropbear_sha2_256 = 
+	{&sha256_desc, 32, 32};
+#endif
+#ifdef DROPBEAR_SHA2_512_HMAC
+static const struct dropbear_hash dropbear_sha2_512 =
+	{&sha512_desc, 64, 64};
+#endif
 #ifdef DROPBEAR_MD5_HMAC
 static const struct dropbear_hash dropbear_md5 = 
 	{&md5_desc, 16, 16};
@@ -156,6 +164,12 @@
 };
 
 algo_type sshhashes[] = {
+#ifdef DROPBEAR_SHA2_256_HMAC
+//	{"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL},
+#endif
+#ifdef DROPBEAR_SHA2_512_HMAC
+//	{"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL},
+#endif
 #ifdef DROPBEAR_SHA1_96_HMAC
 	{"hmac-sha1-96", 0, &dropbear_sha1_96, 1, NULL},
 #endif