Browse Source

fix #38: genenerate_twofactor_code parameter order

pull/41/head
Rossen Georgiev 9 years ago
parent
commit
7c59f6917a
  1. 6
      steam/guard.py
  2. 4
      tests/test_guard.py

6
steam/guard.py

@ -290,15 +290,15 @@ def generate_twofactor_code_for_time(shared_secret, timestamp):
return code return code
def generate_confirmation_key(identity_secret, timestamp, tag=''): def generate_confirmation_key(identity_secret, tag, timestamp):
"""Generate confirmation key for trades. Can only be used once. """Generate confirmation key for trades. Can only be used once.
:param identity_secret: authenticator identity secret :param identity_secret: authenticator identity secret
:type identity_secret: bytes :type identity_secret: bytes
:param timestamp: timestamp to use for generating key
:type timestamp: int
:param tag: tag identifies what the request, see list below :param tag: tag identifies what the request, see list below
:type tag: str :type tag: str
:param timestamp: timestamp to use for generating key
:type timestamp: int
:return: confirmation key :return: confirmation key
:rtype: bytes :rtype: bytes

4
tests/test_guard.py

@ -12,8 +12,8 @@ class TCguard(unittest.TestCase):
self.assertEqual(code, '94R9D') self.assertEqual(code, '94R9D')
def test_generate_confirmation_key(self): def test_generate_confirmation_key(self):
key = g.generate_confirmation_key(b'itsmemario', 100000) key = g.generate_confirmation_key(b'itsmemario', '', 100000)
self.assertEqual(key, b'\xed\xb5\xe5\xad\x8f\xf1\x99\x01\xc8-w\xd6\xb5 p\xccz\xd7\xd1\x05') self.assertEqual(key, b'\xed\xb5\xe5\xad\x8f\xf1\x99\x01\xc8-w\xd6\xb5 p\xccz\xd7\xd1\x05')
key = g.generate_confirmation_key(b'itsmemario', 100000, 'allow') key = g.generate_confirmation_key(b'itsmemario', 'allow', 100000)
self.assertEqual(key, b"Q'\x06\x80\xe1g\xa8m$\xb2hV\xe6g\x8b'\x8f\xf1L\xb0") self.assertEqual(key, b"Q'\x06\x80\xe1g\xa8m$\xb2hV\xe6g\x8b'\x8f\xf1L\xb0")

Loading…
Cancel
Save