Topic: [SOLVED] Bug and/or Wrong docs for Hmac?
I've attached a minimal (~15 lines of code) program reproducing what seems to be either:
1) a bug in the implementation of HMAC-SHA256 (I know this seems unlikely)
or
2) a very confusing piece of example text in the manual (but I've literally copy/pasted the example code)
In a nutshell, changing the amount of space allocated for a stack-allocated output buffer (BEYOND the minimum size required for the expected output) seems to have strange effects on the results. So either something is wrong or I'm grossly misunderstanding what the manual is asking me to do.
I've pasted the correct output, erroneous output, and what I believe to be the relevant manual snippet in a comment inside the test file.
I'm configuring with the following options:
--enable-sha512 --enable-aesgcm --enable-static --enable-dh --enable-opensslextra
I've tried playing with the options and I haven't seen any change in behavior.
I get the same behavior on 2.9 as on 3.2 but I haven't tested any other versions.
Can anyone reproduce this? Or point out what I'm misunderstanding about the example code?
Thanks,
Demetri