diff --git a/reviewboard/hostingsvcs/github.py b/reviewboard/hostingsvcs/github.py
index 70b649d5c614be8d7d1a7f04d5afd4340010143c..ec2ececc8c1a33508c51514594ed7ccacddca73a 100644
--- a/reviewboard/hostingsvcs/github.py
+++ b/reviewboard/hostingsvcs/github.py
@@ -1,5 +1,6 @@
 from __future__ import unicode_literals
 
+import hashlib
 import hmac
 import json
 import logging
@@ -795,8 +796,8 @@ def post_receive_hook_close_submitted(request, local_site_name=None,
                                          local_site_name)
 
     # Validate the hook against the stored UUID.
-    m = hmac.new(bytes(repository.get_or_create_hooks_uuid()))
-    m.update(request.body)
+    m = hmac.new(bytes(repository.get_or_create_hooks_uuid()), request.body,
+                 hashlib.sha1)
 
     sig_parts = request.META.get('HTTP_X_HUB_SIGNATURE').split('=')
 
diff --git a/reviewboard/hostingsvcs/tests.py b/reviewboard/hostingsvcs/tests.py
index 1a6ee1d8090e394688be511f4ac7e7db75f21969..da46d5d492cb5d6ac10612794e246852df9aadd8 100644
--- a/reviewboard/hostingsvcs/tests.py
+++ b/reviewboard/hostingsvcs/tests.py
@@ -1,5 +1,6 @@
 from __future__ import print_function, unicode_literals
 
+import hashlib
 import hmac
 import json
 from hashlib import md5
@@ -1692,8 +1693,7 @@ class GitHubTests(ServiceTests):
             ]
         })
 
-        m = hmac.new(bytes(secret))
-        m.update(payload)
+        m = hmac.new(bytes(secret), payload, hashlib.sha1)
 
         return self.client.post(
             url,
