Skip to content

Commit 8d44e48

Browse files
committed
Be less strict in register_all_hashes()
Allow using all hashes in case we didn't register our ciphers. Nobody should really use CHC, so we shouldn't make it mandatory. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 19a5520 commit 8d44e48

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/misc/crypt/crypt_register_all_hashes.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,13 @@ int register_all_hashes(void)
8989
REGISTER_HASH(&blake2b_512_desc);
9090
#endif
9191
#ifdef LTC_CHC_HASH
92-
REGISTER_HASH(&chc_desc);
93-
LTC_ARGCHK(chc_register(find_cipher_any("aes", 8, 16)) == CRYPT_OK);
92+
{
93+
int aes_index = find_cipher_any("aes", 8, 16);
94+
if (aes_index != -1) {
95+
REGISTER_HASH(&chc_desc);
96+
LTC_ARGCHK(chc_register(aes_index) == CRYPT_OK);
97+
}
98+
}
9499
#endif
95100
return CRYPT_OK;
96101
}

0 commit comments

Comments
 (0)