<div dir="ltr">Your fix introduces a memory leak. Please free 'h' before returning.<div><br></div><div>diff --git a/cipher/kdf.c b/cipher/kdf.c<br>index 2e5eef3..d371bdd 100644<br>--- a/cipher/kdf.c<br>+++ b/cipher/kdf.c<br>@@ -1699,7 +1699,10 @@ hkdf_open (gcry_kdf_hd_t *hd, int macalgo,<br> }<br> <br> if (outlen > 255 * h->blklen)<br>- return GPG_ERR_INV_VALUE;<br>+ {<br>+ xfree (h);<br>+ return GPG_ERR_INV_VALUE;<br>+ }<br> <br> ec = _gcry_mac_open (&h->md, macalgo, 0, NULL);<br> if (ec)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 21, 2022 at 7:02 AM NIIBE Yutaka <<a href="mailto:gniibe@fsij.org">gniibe@fsij.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Guido Vranken wrote:<br>
> HKDF prohibits output sizes which exceed digest size * 255. See section 2.3<br>
> of RFC 5869.<br>
<br>
Thank you.<br>
<br>
Fixed in the commit:<br>
<br>
e0f0c788dc0f268965c0f63eb33d9f98c0575d58<br>
-- <br>
</blockquote></div>