summaryrefslogtreecommitdiffstats
path: root/eopayment
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-10-25 07:15:47 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-10-25 07:18:32 (GMT)
commitbf00e723097ab439868d7d16aa226cca72fab6e0 (patch)
tree1bfe0ef9a069330f67f2c82bd991d24a78fcaca4 /eopayment
parentc5bd2265a213bbd4714dd70f2adde3384340e027 (diff)
downloadeopayment-bf00e723097ab439868d7d16aa226cca72fab6e0.zip
eopayment-bf00e723097ab439868d7d16aa226cca72fab6e0.tar.gz
eopayment-bf00e723097ab439868d7d16aa226cca72fab6e0.tar.bz2
paybox: pass bytes to hashing function (#37212)
Diffstat (limited to 'eopayment')
-rw-r--r--eopayment/paybox.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/eopayment/paybox.py b/eopayment/paybox.py
index cf17ace..a451702 100644
--- a/eopayment/paybox.py
+++ b/eopayment/paybox.py
@@ -22,7 +22,7 @@ import string
import warnings
from .common import (PaymentCommon, PaymentResponse, FORM, PAID, ERROR, Form,
- ORDERID_TRANSACTION_SEPARATOR, ResponseError, force_text)
+ ORDERID_TRANSACTION_SEPARATOR, ResponseError, force_text, force_byte)
__all__ = ['sign', 'Payment']
@@ -142,7 +142,7 @@ def sign(data, key):
def verify(data, signature, key=PAYBOX_KEY):
'''Verify signature using SHA1withRSA by Paybox'''
key = RSA.importKey(key)
- h = SHA.new(data)
+ h = SHA.new(force_byte(data))
verifier = PKCS1_v1_5.new(key)
return verifier.verify(h, signature)