From 1991bdac0da9569c3f1dd416461d5a58fb24dd7d Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Mon, 14 Dec 2020 11:58:00 +0100 Subject: [PATCH] Remove unneeded version conditional The HMAC_CTX_free function in the compat layer already handles this so there's no need to add conditional logic to the code here. Signed-off-by: Dirkjan Bussink Reviewed-by: Jakub Jelen --- src/libcrypto.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/libcrypto.c b/src/libcrypto.c index 0dc103c3..cf375603 100644 --- a/src/libcrypto.c +++ b/src/libcrypto.c @@ -454,17 +454,10 @@ void hmac_update(HMACCTX ctx, const void *data, unsigned long len) { HMAC_Update(ctx, data, len); } -void hmac_final(HMACCTX ctx, unsigned char *hashmacbuf, unsigned int *len) { - HMAC_Final(ctx,hashmacbuf,len); - -#if OPENSSL_VERSION_NUMBER > 0x10100000L - HMAC_CTX_free(ctx); - ctx = NULL; -#else - HMAC_cleanup(ctx); - SAFE_FREE(ctx); - ctx = NULL; -#endif +void hmac_final(HMACCTX ctx, unsigned char *hashmacbuf, unsigned int *len) +{ + HMAC_Final(ctx, hashmacbuf, len); + HMAC_CTX_free(ctx); } static void evp_cipher_init(struct ssh_cipher_struct *cipher) {