0001-fix-key-type-in-request-signing.patch
passerelle/base/signature.py | ||
---|---|---|
33 | 33 | |
34 | 34 |
def sign_string(s, key, algo='sha256', timedelta=30): |
35 | 35 |
digestmod = getattr(hashlib, algo) |
36 |
if isinstance(key, unicode): |
|
37 |
key = key.decode('utf-8') |
|
36 | 38 |
hash = hmac.HMAC(key, digestmod=digestmod, msg=s) |
37 | 39 |
return hash.digest() |
38 | 40 | |
39 |
- |