codec_hmac uses hmac key

This commit is contained in:
Stephen Lombardo 2011-02-17 00:14:54 -05:00
parent f003dfad13
commit 3aefd5e5de

View File

@ -288,7 +288,7 @@ static int codec_key_derive(codec_ctx *ctx, cipher_ctx *c_ctx) {
static int codec_hmac(cipher_ctx *ctx, Pgno pgno, unsigned char *in, int in_sz, unsigned char *out) { static int codec_hmac(cipher_ctx *ctx, Pgno pgno, unsigned char *in, int in_sz, unsigned char *out) {
HMAC_CTX hctx; HMAC_CTX hctx;
HMAC_CTX_init(&hctx); HMAC_CTX_init(&hctx);
HMAC_Init_ex(&hctx, ctx->key, ctx->key_sz, EVP_sha1(), NULL); HMAC_Init_ex(&hctx, ctx->hmac_key, ctx->key_sz, EVP_sha1(), NULL);
/* include the encrypted page data, initialization vector, and page number in HMAC. This will /* include the encrypted page data, initialization vector, and page number in HMAC. This will
prevent both tampering with the ciphertext, manipulation of the IV, or resequencing otherwise prevent both tampering with the ciphertext, manipulation of the IV, or resequencing otherwise