Skip to content

Commit

Permalink
Added compatibility with Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
armicron committed Apr 23, 2017
1 parent c9963a6 commit 0bffe23
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions warrant/aws_srp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import hashlib
import hmac
import sys

import boto3
import os
Expand Down Expand Up @@ -154,8 +155,11 @@ def process_challenge(self, challenge_parameters, test_timestamp=None):
salt_hex = challenge_parameters['SALT']
srp_b_hex = challenge_parameters['SRP_B']
secret_block_b64 = challenge_parameters['SECRET_BLOCK']
timestamp = test_timestamp or \
datetime.datetime.utcnow().strftime("%a %b %-d %H:%M:%S UTC %Y")
if sys.platform.startswith('win'):
format_string = "%a %b %#d %H:%M:%S UTC %Y"
else:
format_string = "%a %b %-d %H:%M:%S UTC %Y"
timestamp = test_timestamp or datetime.datetime.utcnow().strftime(format_string)
hkdf = self.get_password_authentication_key(user_id_for_srp,
self.password, hex_to_long(srp_b_hex), salt_hex)
secret_block_bytes = base64.standard_b64decode(secret_block_b64)
Expand Down

0 comments on commit 0bffe23

Please sign in to comment.