parse hex string for hmac
This commit is contained in:
		@@ -75,6 +75,7 @@ class ReceiverId(object):
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def signChallenge(challenge, key):
 | 
			
		||||
        now = datetime.utcnow().isoformat()
 | 
			
		||||
        signString = "{challenge}:{time}".format(challenge=challenge.challenge, time=now)
 | 
			
		||||
        m = hmac.new(bytes.fromhex(key.secret), msg=signString.encode('utf8'), digestmod=hashlib.sha256)
 | 
			
		||||
        m = hmac.new(bytes.fromhex(key.secret), digestmod=hashlib.sha256)
 | 
			
		||||
        m.update(bytes.fromhex(challenge.challenge))
 | 
			
		||||
        m.update(now.encode('utf8'))
 | 
			
		||||
        return now, m.hexdigest()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user