projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95e1cc3
)
Round up the size of the secret parts after splitting it in two.
author
Guus Sliepen
<guus@tinc-vpn.org>
Mon, 4 Jul 2011 05:51:47 +0000
(07:51 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Mon, 4 Jul 2011 05:51:47 +0000
(07:51 +0200)
src/openssl/prf.c
patch
|
blob
|
history
diff --git
a/src/openssl/prf.c
b/src/openssl/prf.c
index
59e8a3a
..
df7f445
100644
(file)
--- 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);
}