8000 fix hmac calls on macosx · devstator82/sqlcipher@5d4ded1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d4ded1

Browse files
committed
fix hmac calls on macosx
1 parent 1511806 commit 5d4ded1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/crypto_impl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,14 @@ int sqlcipher_page_hmac(cipher_ctx *ctx, Pgno pgno, unsigned char *in, int in_sz
395395
HMAC_CTX hctx;
396396
HMAC_CTX_init(&hctx);
397397

398-
if(!HMAC_Init_ex(&hctx, ctx->hmac_key, ctx->key_sz, EVP_sha1(), NULL)) return SQLITE_ERROR;
398+
HMAC_Init_ex(&hctx, ctx->hmac_key, ctx->key_sz, EVP_sha1(), NULL);
399399

400400
/* include the encrypted page data, initialization vector, and page number in HMAC. This will
401401
prevent both tampering with the ciphertext, manipulation of the IV, or resequencing otherwise
402402
valid pages out of order in a database */
403-
if(!HMAC_Update(&hctx, in, in_sz)) return SQLITE_ERROR;
404-
if(!HMAC_Update(&hctx, (const unsigned char*) &pgno, sizeof(Pgno))) return SQLITE_ERROR;
405-
if(!HMAC_Final(&hctx, out, NULL)) return SQLITE_ERROR;
403+
HMAC_Update(&hctx, in, in_sz);
404+
HMAC_Update(&hctx, (const unsigned char*) &pgno, sizeof(Pgno));
405+
HMAC_Final(&hctx, out, NULL);
406406
HMAC_CTX_cleanup(&hctx);
407407
return SQLITE_OK;
408408
}

0 commit comments

Comments
 (0)
0