projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
proper shutdown
[oweals/gnunet.git]
/
src
/
util
/
crypto_hkdf.c
diff --git
a/src/util/crypto_hkdf.c
b/src/util/crypto_hkdf.c
index eb91780cbbc8f39fa49d70ddcb2f21514f2f6a17..494f3d0ab9efcda76f4fc560bfb3ccbecefde1de 100644
(file)
--- a/
src/util/crypto_hkdf.c
+++ b/
src/util/crypto_hkdf.c
@@
-161,10
+161,6
@@
GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len,
if (k == 0)
return GNUNET_SYSERR;
if (k == 0)
return GNUNET_SYSERR;
- // FIXME: what is the check for?
- if (out_len > (2 ^ 32 * k))
- return GNUNET_SYSERR;
-
if (gcry_md_open(&xtr, xtr_algo, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
return GNUNET_SYSERR;
if (gcry_md_open(&xtr, xtr_algo, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
return GNUNET_SYSERR;
@@
-246,8
+242,11
@@
GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len,
if (d > 0)
{
if (t > 0)
if (d > 0)
{
if (t > 0)
- memcpy (plain, result - k, k);
- memset (plain + k + ctx_len, i + 1, 1);
+ {
+ memcpy (plain, result - k, k);
+ i++;
+ }
+ memset (plain + k + ctx_len, i, 1);
gcry_md_reset (prf);
#if DEBUG_HKDF
dump("K(t):d", plain, plain_len);
gcry_md_reset (prf);
#if DEBUG_HKDF
dump("K(t):d", plain, plain_len);
@@
-287,8
+286,6
@@
hkdf_ok:
* @param xts_len length of xts
* @param skm source key material
* @param skm_len length of skm
* @param xts_len length of xts
* @param skm source key material
* @param skm_len length of skm
- * @param ctx context info
- * @param ctx_len length of ctx
* @return GNUNET_YES on success
*/
int
* @return GNUNET_YES on success
*/
int