From b99656d84a88dad7935d5981fcdb43a5b2bfa417 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 4 Jul 2011 07:51:47 +0200 Subject: [PATCH] Round up the size of the secret parts after splitting it in two. --- src/openssl/prf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openssl/prf.c b/src/openssl/prf.c index 59e8a3aa..df7f445c 100644 --- a/src/openssl/prf.c +++ b/src/openssl/prf.c @@ -71,6 +71,6 @@ bool prf(char *secret, size_t secretlen, char *seed, size_t seedlen, char *out, memset(out, 0, outlen); - return prf_xor(NID_sha512, secret, secretlen / 2, seed, seedlen, out, outlen) - && prf_xor(NID_whirlpool, secret, secretlen / 2, seed, seedlen, out, outlen); + return prf_xor(NID_sha512, secret, (secretlen + 1) / 2, seed, seedlen, out, outlen) + && prf_xor(NID_whirlpool, secret + secretlen / 2, (secretlen + 1) / 2, seed, seedlen, out, outlen); } -- 2.39.5