Changeset

1109:d988f2db9773

mod_pubsub_googlecode: Import hmac from util.hashes
author Kim Alvefur <zash@zash.se>
date Thu, 11 Jul 2013 16:51:37 +0200
parents 1108:2da546139cb5
children 1110:97e238ce37ce
files mod_pubsub_googlecode/mod_pubsub_googlecode.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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.";