Encode to utf-8 before hashing.
This commit is contained in:
parent
af9f53eca6
commit
565146ac3d
1 changed files with 7 additions and 2 deletions
|
@ -64,8 +64,13 @@ class PyiCloudService(object):
|
||||||
if 'dsInfo' in resp:
|
if 'dsInfo' in resp:
|
||||||
dsid = resp['dsInfo']['dsid']
|
dsid = resp['dsInfo']['dsid']
|
||||||
self.params.update({'dsid': dsid})
|
self.params.update({'dsid': dsid})
|
||||||
instance = resp.get('instance', uuid.uuid4().hex)
|
instance = resp.get(
|
||||||
sha = hashlib.sha1(self.user.get('apple_id') + instance)
|
'instance',
|
||||||
|
uuid.uuid4().hex.encode('utf-8')
|
||||||
|
)
|
||||||
|
sha = hashlib.sha1(
|
||||||
|
self.user.get('apple_id').encode('utf-8') + instance
|
||||||
|
)
|
||||||
self.params.update({'id': sha.hexdigest().upper()})
|
self.params.update({'id': sha.hexdigest().upper()})
|
||||||
|
|
||||||
def authenticate(self):
|
def authenticate(self):
|
||||||
|
|
Loading…
Reference in a new issue