From: Florian Forster Date: Wed, 29 Jan 2014 07:11:50 +0000 (+0100) Subject: libcollectdclient: Fix size argument passed to CryptImportKey(). X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ce8ac986e62b08f6bacc8bc1b1af04eb56608569;p=collectd.git libcollectdclient: Fix size argument passed to CryptImportKey(). --- diff --git a/src/libcollectdclient/win_hmac.c b/src/libcollectdclient/win_hmac.c index cf102d2b..7448e264 100644 --- a/src/libcollectdclient/win_hmac.c +++ b/src/libcollectdclient/win_hmac.c @@ -75,7 +75,8 @@ static HCRYPTKEY create_hmac_key_exact (HCRYPTPROV hProv, * The "CRYPT_IPSEC_HMAC_KEY" is required to allow RC2 keys longer than * 16 byte. Again, this is documented on the "CryptImportKey" page as a * side note. */ - status = CryptImportKey (hProv, (BYTE *) data, sizeof (data), + status = CryptImportKey (hProv, (BYTE *) data, + /* dwDataLen = */ sizeof (*data) + data->key_size, /* public key = */ 0, /* flags = */ CRYPT_IPSEC_HMAC_KEY, &ret_key);