comparison crypto_desc.c @ 1916:3f4cdf839a1a

Make SHA1 optional, implement SHA256 fingerprints SHA256 is always compiled and only enable SHA1 when needed. Fingerprints are always SHA256: base64 format, md5 and sha1 are removed. dbrandom now uses sha256 its hash function.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 30 Mar 2022 11:44:04 +0800
parents 13cb8cc1b0e4
children
comparison
equal deleted inserted replaced
1915:13cb8cc1b0e4 1916:3f4cdf839a1a
29 #endif 29 #endif
30 NULL 30 NULL
31 }; 31 };
32 32
33 const struct ltc_hash_descriptor *reghashes[] = { 33 const struct ltc_hash_descriptor *reghashes[] = {
34 /* we need sha1 for hostkey stuff regardless */ 34 #if DROPBEAR_SHA1_HMAC
35 &sha1_desc, 35 &sha1_desc,
36 #endif
36 #if DROPBEAR_MD5_HMAC 37 #if DROPBEAR_MD5_HMAC
37 &md5_desc, 38 &md5_desc,
38 #endif 39 #endif
39 #if DROPBEAR_SHA256 40 #if DROPBEAR_SHA256
40 &sha256_desc, 41 &sha256_desc,
44 #endif 45 #endif
45 #if DROPBEAR_SHA512 46 #if DROPBEAR_SHA512
46 &sha512_desc, 47 &sha512_desc,
47 #endif 48 #endif
48 NULL 49 NULL
49 }; 50 };
50 int i; 51 int i;
51 52
52 for (i = 0; regciphers[i] != NULL; i++) { 53 for (i = 0; regciphers[i] != NULL; i++) {
53 if (register_cipher(regciphers[i]) == -1) { 54 if (register_cipher(regciphers[i]) == -1) {
54 dropbear_exit("Error registering crypto"); 55 dropbear_exit("Error registering crypto");
55 } 56 }
56 } 57 }