Closed simonster closed 9 years ago
Hmm, I can't find any mention of a change of this sort in the GnuTLS API in their NEWS file.
This fact that gnutls_hmac_output
resets the state of the MAC was only documented on April 27, which means that it may be new to GnuTLS 3.1.11 (released May 10). In particular, it looks like the reset functionality was changed on 27 April in this commit and this commit, but it's not clear to me if that was actually a point at which the gnutls_hmac_output
semantics changed, or if it was a fix for compatibility with a libnettle release.
But then, it works for @simonster in 3.1.10 (released March 22), so maybe the April 27 fixes are unrelated?
It's not clear to me if there ever was a separate function to reset the hmac in GnuTLS.
My suspicion at this point is that (assuming the hmac in 2.12.5 worked at some point) there is an incompatibility between recent libnettle versions and older GnuTLS versions.
I posted a question on the gnutls mailing list to see if we can get any clarification on this.
Progress! The GnuTLS developers say that the problem is that you need to have a GnuTLS linked with Nettle rather than libgcrypt in order for the HMAC to be reset on update. Nettle became the default in GnuTLS 2.11.1, but libgcrypt is still an option.
@simonster, can you confirm that your 2.12.5 was linked with libgcrypt rather than libnettle?
Yes, it was, and so is the Ubuntu libgnutls26 package.
Tidying up and closing this out, since it appears to reference a problem in versions of GnuTLS that are deprecated.
The following test passes in 3.1.10 but fails in 2.12.5:
In 2.12.5, I get
6b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920
the second time around. I'm not actually sure where this comes from, sinceyields
563d87fd06455e5809679f6153df494301b543b9720113876ac44e0c9fd55299
.This seems like it could be fixed by reinitializing the HMAC after
hexdigest!
for old versions of GnuTLS, although I'm not sure when this was fixed/changed.