The block size wasn’t configured before, so calling g_hmac_new() with G_CHECKSUM_SHA512 would hit a g_assert_not_reached() and explode.
Implement G_CHECKSUM_SHA512 and add unit tests for HMACs with SHA-256 and SHA-512 using the test vectors from RFC 4868.
https://bugzilla.gnome.org/show_bug.cgi?id=724741
7a86a66 hmac: Add support for SHA-512 in GHmac
glib/ghmac.c | 10 ++-
glib/tests/hmac.c | 177 +++++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 173 insertions(+), 14 deletions(-)
Upstream: git.gnome.org