spplus: handle secret key as string (#46432)
This commit is contained in:
parent
1ee8871eda
commit
5991c69c4e
|
@ -75,7 +75,7 @@ TEST_STATE = ('99',)
|
|||
|
||||
|
||||
def decrypt_ntkey(ntkey):
|
||||
key = binascii.unhexlify(ntkey.replace(b' ', b''))
|
||||
key = binascii.unhexlify(force_byte(ntkey).replace(b' ', b''))
|
||||
return decrypt_key(key)
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import eopayment.spplus as spplus
|
||||
from eopayment import ResponseError
|
||||
from eopayment import ResponseError, force_text
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -41,3 +41,7 @@ def test_spplus():
|
|||
|
||||
with pytest.raises(ResponseError, match=r'missing reference, etat or refsfp'):
|
||||
payment.response('foo=bar')
|
||||
|
||||
# make sure key string and bytes representations are understood
|
||||
spplus.decrypt_ntkey(force_text(ntkey))
|
||||
spplus.decrypt_ntkey(ntkey)
|
||||
|
|
Loading…
Reference in New Issue