Mercurial > dropbear
comparison fuzzer-verify.c @ 1688:e01f9ec6d177
Fix untested rsa-sha256 change to fuzzer-verify
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 26 May 2020 23:13:23 +0800 |
parents | d5cdc60db08e |
children |
comparison
equal
deleted
inserted
replaced
1687:f8d8af12ac14 | 1688:e01f9ec6d177 |
---|---|
1 #include "fuzz.h" | 1 #include "fuzz.h" |
2 #include "session.h" | 2 #include "session.h" |
3 #include "fuzz-wrapfd.h" | 3 #include "fuzz-wrapfd.h" |
4 #include "debug.h" | 4 #include "debug.h" |
5 #include "dss.h" | |
5 | 6 |
6 static void setup_fuzzer(void) { | 7 static void setup_fuzzer(void) { |
7 fuzz_common_setup(); | 8 fuzz_common_setup(); |
8 } | 9 } |
9 | 10 |
30 enum signkey_type keytype = DROPBEAR_SIGNKEY_ANY; | 31 enum signkey_type keytype = DROPBEAR_SIGNKEY_ANY; |
31 if (buf_get_pub_key(fuzz.input, key, &keytype) == DROPBEAR_SUCCESS) { | 32 if (buf_get_pub_key(fuzz.input, key, &keytype) == DROPBEAR_SUCCESS) { |
32 enum signature_type sigtype; | 33 enum signature_type sigtype; |
33 if (keytype == DROPBEAR_SIGNKEY_RSA) { | 34 if (keytype == DROPBEAR_SIGNKEY_RSA) { |
34 /* Flip a coin to decide rsa signature type */ | 35 /* Flip a coin to decide rsa signature type */ |
35 int flag = buf_getbyte(fuzz_input); | 36 int flag = buf_getbyte(fuzz.input); |
36 if (flag & 0x01) { | 37 if (flag & 0x01) { |
37 sigtype = DROPBEAR_SIGNATURE_RSA_SHA256; | 38 sigtype = DROPBEAR_SIGNATURE_RSA_SHA256; |
38 } else { | 39 } else { |
39 sigtype = DROPBEAR_SIGNATURE_RSA_SHA1; | 40 sigtype = DROPBEAR_SIGNATURE_RSA_SHA1; |
40 } | 41 } |