# HG changeset patch # User Kim Alvefur # Date 1373554297 -7200 # Node ID d988f2db9773e9741d7a9f0f2a59708f5cbd185b # Parent 2da546139cb5f1b52e392ebe61bfd1e7f72ffc54 mod_pubsub_googlecode: Import hmac from util.hashes diff -r 2da546139cb5 -r d988f2db9773 mod_pubsub_googlecode/mod_pubsub_googlecode.lua --- a/mod_pubsub_googlecode/mod_pubsub_googlecode.lua Thu Jul 11 16:51:27 2013 +0200 +++ b/mod_pubsub_googlecode/mod_pubsub_googlecode.lua Thu Jul 11 16:51:37 2013 +0200 @@ -3,7 +3,7 @@ local st = require "util.stanza"; local json = require "util.json"; local formdecode = require "net.http".formdecode; -local hmac = require "util.hmac"; +local hmac_md5 = require "util.hashes".hmac_md5; local st = require "util.stanza"; local json = require "util.json"; local datetime = require "util.datetime".datetime; @@ -24,7 +24,7 @@ if auth_key then local digest_header = request.headers["google-code-project-hosting-hook-hmac"]; - local digest = hmac.md5(auth_key, body, true); + local digest = hmac_md5(auth_key, body, true); if digest ~= digest_header then module:log("warn", "Commit POST failed authentication check, sender gave %s, we got %s, body was:\n%s", tostring(digest_header), tostring(digest), tostring(body)); return "No thanks.";