GNOME Bugzilla – Bug 658725
use GHmac instead of your own hmac implementation
Last modified: 2016-04-19 10:11:05 UTC
GLib 2.30 comes with a hmac implementation that is meant to replace the various self-made ones throughout the stack. See bug 652480
Created attachment 216600 [details] [review] Use HMAC glib implementation instead of rolling our own
I've only compile tested this patch, I'm not sure what to use to trigger hmac use in oauth.
And this is missing -PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.24) +PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.30)
(In reply to comment #2) > I've only compile tested this patch, I'm not sure what to use to trigger hmac > use in oauth. Looks like it's missing some base64 encoding
OAuth uses it. Running make check should exercise it.
ping, how about it, after a few years ?
Iirc make check was totally failing with this patch, never investigated why. More work needed.. ;)
Created attachment 312673 [details] [review] Use GHmac in sha.c Basically does what the old implementation did, but usig GHmac and saving a few LOC. I'm not sure about the guchar casts, just tried this patch quickly. We can't use g_compute_hmac_for_string directly since we need the digest (and base64 encode that).
and yeah a missing g_hmac_unref :(
Review of attachment 312673 [details] [review]: Looks fine/passes make dist.
Review of attachment 312673 [details] [review]: Feel free to push with the change you mentioned.
Okay, pushed. Thanks.
Ah hmm this needs glib 2.30 :(
I assume that's some sort of problem? Do you want a patch for bumping the glib dep or should we just revert that and wait until after the 0.8 release?
I would have preferred to bump the glib req only in a new 0.9 series. I'll branch 0.8 and release, unless you prefer a revert/release/reapply
Do what you think is right, I don't have a strong opinion in any case and you have more experience. :)
I believe we can close this one as the code is in git master.