sync code with last fixes and improvements from OpenBSD
This commit is contained in:
parent
4b78db449c
commit
bf0676207f
2406 changed files with 6353 additions and 434004 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: hkdf.c,v 1.8 2022/11/26 16:08:53 tb Exp $ */
|
||||
/* $OpenBSD: hkdf.c,v 1.9 2023/06/01 02:34:23 tb Exp $ */
|
||||
/* Copyright (c) 2014, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -102,7 +102,7 @@ HKDF_expand(uint8_t *out_key, size_t out_len,
|
|||
goto out;
|
||||
|
||||
todo = digest_len;
|
||||
if (done + todo > out_len)
|
||||
if (todo > out_len - done)
|
||||
todo = out_len - done;
|
||||
|
||||
memcpy(out_key + done, previous, todo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue