MoinMoin/security/textcha.py
changeset 6128 561b7a9c2bd9
parent 6103 500f68d3e2fd
     1.1 --- a/MoinMoin/security/textcha.py	Mon Oct 31 22:58:54 2016 +0100
     1.2 +++ b/MoinMoin/security/textcha.py	Tue Nov 01 17:56:32 2016 +0100
     1.3 @@ -19,7 +19,7 @@
     1.4      @copyright: 2007 by MoinMoin:ThomasWaldmann
     1.5      @license: GNU GPL, see COPYING for details.
     1.6  """
     1.7 -import hmac
     1.8 +import hmac, hashlib
     1.9  import re
    1.10  import random
    1.11  
    1.12 @@ -84,7 +84,7 @@
    1.13  
    1.14      def _compute_signature(self, question, timestamp):
    1.15          signature = u"%s%d" % (question, timestamp)
    1.16 -        return hmac.new(self.secret, signature.encode('utf-8')).hexdigest()
    1.17 +        return hmac.new(self.secret, signature.encode('utf-8'), digestmod=hashlib.sha1).hexdigest()
    1.18  
    1.19      def _init_qa(self, question=None):
    1.20          """ Initialize the question / answer.