mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-11-21 21:25:50 +00:00
Catch up with OpenSSL API changes.
This commit is contained in:
parent
b915055c2b
commit
6d8a39589f
5 changed files with 30 additions and 30 deletions
|
@ -48,13 +48,13 @@ static void
|
||||||
t_hmac_sha1_complete(const void *key, size_t keylen,
|
t_hmac_sha1_complete(const void *key, size_t keylen,
|
||||||
const void *msg, size_t msglen, uint8_t *mac)
|
const void *msg, size_t msglen, uint8_t *mac)
|
||||||
{
|
{
|
||||||
HMAC_CTX ctx;
|
HMAC_CTX *ctx;
|
||||||
|
|
||||||
HMAC_CTX_init(&ctx);
|
ctx = HMAC_CTX_new();
|
||||||
HMAC_Init_ex(&ctx, key, keylen, EVP_sha1(), NULL);
|
HMAC_Init_ex(ctx, key, keylen, EVP_sha1(), NULL);
|
||||||
HMAC_Update(&ctx, msg, msglen);
|
HMAC_Update(ctx, msg, msglen);
|
||||||
HMAC_Final(&ctx, mac, NULL);
|
HMAC_Final(ctx, mac, NULL);
|
||||||
HMAC_CTX_cleanup(&ctx);
|
HMAC_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -48,13 +48,13 @@ static void
|
||||||
t_hmac_sha224_complete(const void *key, size_t keylen,
|
t_hmac_sha224_complete(const void *key, size_t keylen,
|
||||||
const void *msg, size_t msglen, uint8_t *mac)
|
const void *msg, size_t msglen, uint8_t *mac)
|
||||||
{
|
{
|
||||||
HMAC_CTX ctx;
|
HMAC_CTX *ctx;
|
||||||
|
|
||||||
HMAC_CTX_init(&ctx);
|
ctx = HMAC_CTX_new();
|
||||||
HMAC_Init_ex(&ctx, key, keylen, EVP_sha224(), NULL);
|
HMAC_Init_ex(ctx, key, keylen, EVP_sha224(), NULL);
|
||||||
HMAC_Update(&ctx, msg, msglen);
|
HMAC_Update(ctx, msg, msglen);
|
||||||
HMAC_Final(&ctx, mac, NULL);
|
HMAC_Final(ctx, mac, NULL);
|
||||||
HMAC_CTX_cleanup(&ctx);
|
HMAC_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -48,13 +48,13 @@ static void
|
||||||
t_hmac_sha256_complete(const void *key, size_t keylen,
|
t_hmac_sha256_complete(const void *key, size_t keylen,
|
||||||
const void *msg, size_t msglen, uint8_t *mac)
|
const void *msg, size_t msglen, uint8_t *mac)
|
||||||
{
|
{
|
||||||
HMAC_CTX ctx;
|
HMAC_CTX *ctx;
|
||||||
|
|
||||||
HMAC_CTX_init(&ctx);
|
ctx = HMAC_CTX_new();
|
||||||
HMAC_Init_ex(&ctx, key, keylen, EVP_sha256(), NULL);
|
HMAC_Init_ex(ctx, key, keylen, EVP_sha256(), NULL);
|
||||||
HMAC_Update(&ctx, msg, msglen);
|
HMAC_Update(ctx, msg, msglen);
|
||||||
HMAC_Final(&ctx, mac, NULL);
|
HMAC_Final(ctx, mac, NULL);
|
||||||
HMAC_CTX_cleanup(&ctx);
|
HMAC_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -48,13 +48,13 @@ static void
|
||||||
t_hmac_sha384_complete(const void *key, size_t keylen,
|
t_hmac_sha384_complete(const void *key, size_t keylen,
|
||||||
const void *msg, size_t msglen, uint8_t *mac)
|
const void *msg, size_t msglen, uint8_t *mac)
|
||||||
{
|
{
|
||||||
HMAC_CTX ctx;
|
HMAC_CTX *ctx;
|
||||||
|
|
||||||
HMAC_CTX_init(&ctx);
|
ctx = HMAC_CTX_new();
|
||||||
HMAC_Init_ex(&ctx, key, keylen, EVP_sha384(), NULL);
|
HMAC_Init_ex(ctx, key, keylen, EVP_sha384(), NULL);
|
||||||
HMAC_Update(&ctx, msg, msglen);
|
HMAC_Update(ctx, msg, msglen);
|
||||||
HMAC_Final(&ctx, mac, NULL);
|
HMAC_Final(ctx, mac, NULL);
|
||||||
HMAC_CTX_cleanup(&ctx);
|
HMAC_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -48,13 +48,13 @@ static void
|
||||||
t_hmac_sha512_complete(const void *key, size_t keylen,
|
t_hmac_sha512_complete(const void *key, size_t keylen,
|
||||||
const void *msg, size_t msglen, uint8_t *mac)
|
const void *msg, size_t msglen, uint8_t *mac)
|
||||||
{
|
{
|
||||||
HMAC_CTX ctx;
|
HMAC_CTX *ctx;
|
||||||
|
|
||||||
HMAC_CTX_init(&ctx);
|
ctx = HMAC_CTX_new();
|
||||||
HMAC_Init_ex(&ctx, key, keylen, EVP_sha512(), NULL);
|
HMAC_Init_ex(ctx, key, keylen, EVP_sha512(), NULL);
|
||||||
HMAC_Update(&ctx, msg, msglen);
|
HMAC_Update(ctx, msg, msglen);
|
||||||
HMAC_Final(&ctx, mac, NULL);
|
HMAC_Final(ctx, mac, NULL);
|
||||||
HMAC_CTX_cleanup(&ctx);
|
HMAC_CTX_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue