From aa7f9a85f7464e6f3ad87a806c1163d708550f04 Mon Sep 17 00:00:00 2001 From: Alexander Lamaison Date: Mon, 16 Mar 2015 23:15:33 +0000 Subject: [PATCH] Fix breakage in WinCNG backend caused by introducing libssh2_hmac_ctx_init. The macro was defined to nothing for the libgcrypt backend, but not for WinCNG. This brings the latter into line with the former. --- src/knownhost.c | 2 +- src/wincng.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/knownhost.c b/src/knownhost.c index 102cdee..a32dcf8 100644 --- a/src/knownhost.c +++ b/src/knownhost.c @@ -417,9 +417,9 @@ knownhost_check(LIBSSH2_KNOWNHOSTS *hosts, plain input to produce a hash to compare with the stored hash. */ + unsigned char hash[SHA_DIGEST_LENGTH]; libssh2_hmac_ctx ctx; libssh2_hmac_ctx_init(ctx); - unsigned char hash[SHA_DIGEST_LENGTH]; if(SHA_DIGEST_LENGTH != node->name_len) { /* the name hash length must be the sha1 size or diff --git a/src/wincng.h b/src/wincng.h index 9f4ed08..57c6ba2 100644 --- a/src/wincng.h +++ b/src/wincng.h @@ -149,6 +149,7 @@ typedef struct __libssh2_wincng_hash_ctx { */ #define libssh2_hmac_ctx _libssh2_wincng_hash_ctx +#define libssh2_hmac_ctx_init(ctx) #define libssh2_hmac_sha1_init(ctx, key, keylen) \ _libssh2_wincng_hash_init(ctx, _libssh2_wincng.hAlgHmacSHA1, \ SHA_DIGEST_LENGTH, key, keylen)