summaryrefslogtreecommitdiffhomepage
path: root/common-algo.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-03-21 22:55:12 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-03-21 22:55:12 +0800
commit024d268d8c3323cc16484ff2b72db702cba2464c (patch)
treedd8211380f32e4901fc17c4afe2a8153e01099e4 /common-algo.c
parenteaa737fecd57fff0950f616a63a421d1f82d4c61 (diff)
Make hmac-sha2-256 and hmac-sha2-512 work
Diffstat (limited to 'common-algo.c')
-rw-r--r--common-algo.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/common-algo.c b/common-algo.c
index 8c1ee04..4a14651 100644
--- a/common-algo.c
+++ b/common-algo.c
@@ -45,8 +45,8 @@ static int void_start(int cipher, const unsigned char *IV,
/* 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 sshciphers[] = {
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 @@ void crypto_init() {
#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;