Rename buffer to key in hmac_init in crypto backend.

It is key and naming was confusing.
This commit is contained in:
Milan Broz
2018-02-23 10:14:00 +01:00
parent b4fc36ea62
commit dee38e9c0b
6 changed files with 14 additions and 14 deletions

View File

@@ -215,7 +215,7 @@ int crypt_hmac_size(const char *name)
}
int crypt_hmac_init(struct crypt_hmac **ctx, const char *name,
const void *buffer, size_t length)
const void *key, size_t key_length)
{
struct crypt_hmac *h;
@@ -229,12 +229,12 @@ int crypt_hmac_init(struct crypt_hmac **ctx, const char *name,
if (!h->hash)
goto bad;
h->key = malloc(length);
h->key = malloc(key_length);
if (!h->key)
goto bad;
memcpy(h->key, buffer, length);
h->key_length = length;
memcpy(h->key, key, key_length);
h->key_length = key_length;
h->hash->init(&h->nettle_ctx);
h->hash->hmac_set_key(&h->nettle_ctx, h->key_length, h->key);