From 5d4ded185023c3d7dffa95d5236a685a56f03ba8 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Tue, 27 Dec 2011 12:27:41 -0500 Subject: [PATCH] fix hmac calls on macosx --- src/crypto_impl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto_impl.c b/src/crypto_impl.c index 62fa562d..ebe8969c 100644 --- a/src/crypto_impl.c +++ b/src/crypto_impl.c @@ -395,14 +395,14 @@ int sqlcipher_page_hmac(cipher_ctx *ctx, Pgno pgno, unsigned char *in, int in_sz HMAC_CTX hctx; HMAC_CTX_init(&hctx); - if(!HMAC_Init_ex(&hctx, ctx->hmac_key, ctx->key_sz, EVP_sha1(), NULL)) return SQLITE_ERROR; + 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 prevent both tampering with the ciphertext, manipulation of the IV, or resequencing otherwise valid pages out of order in a database */ - if(!HMAC_Update(&hctx, in, in_sz)) return SQLITE_ERROR; - if(!HMAC_Update(&hctx, (const unsigned char*) &pgno, sizeof(Pgno))) return SQLITE_ERROR; - if(!HMAC_Final(&hctx, out, NULL)) return SQLITE_ERROR; + HMAC_Update(&hctx, in, in_sz); + HMAC_Update(&hctx, (const unsigned char*) &pgno, sizeof(Pgno)); + HMAC_Final(&hctx, out, NULL); HMAC_CTX_cleanup(&hctx); return SQLITE_OK; }