diff --git a/src/knownhost.c b/src/knownhost.c index 102cdee0..a32dcf87 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 9f4ed085..57c6ba23 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)