From a9ce2210bc0040ab7f1d9b8c39d190d387664d41 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Mon, 25 Jul 2011 21:15:41 +0000 Subject: [PATCH] Fix gcrypt final() function backend call. git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@580 36d66b0a-2a48-0410-832c-cd162a569da5 --- lib/crypto_backend/crypto_gcrypt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/crypto_backend/crypto_gcrypt.c b/lib/crypto_backend/crypto_gcrypt.c index 2c9e72d..072faeb 100644 --- a/lib/crypto_backend/crypto_gcrypt.c +++ b/lib/crypto_backend/crypto_gcrypt.c @@ -139,9 +139,9 @@ int crypt_hash_final(struct crypt_hash *ctx, char *buffer, size_t length) if (!hash) return -EINVAL; + memcpy(buffer, hash, length); crypt_hash_restart(ctx); - memcpy(buffer, hash, length); return 0; } @@ -214,9 +214,9 @@ int crypt_hmac_final(struct crypt_hmac *ctx, char *buffer, size_t length) if (!hash) return -EINVAL; + memcpy(buffer, hash, length); crypt_hmac_restart(ctx); - memcpy(buffer, hash, length); return 0; } -- 2.7.4