forked from picklepete/pyicloud
-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Tim,
I am updating the SrpPassword class in srp_password.py in iCloud3 to your latest version and have found that the password_digest variable is always set to None after the self.protocol comparison tests
For reference, lines 38-43 are:
password_digest: bytes | None = None
if self.protocol == SrpProtocolType.S2K_FO:
password_digest = self._password_hash.hex().encode()
elif self.protocol == SrpProtocolType.S2K:
password_digest = self._password_hash
if password_digest is None:
raise ValueError("Unsupported SrpPassword type")
The values of the variables are:
if self.protocol == SrpProtocolType.S2K_FO:
...
if self.protocol == SrpProtocolType.S2K:
...
self.protocol='s2k'
SrpProtocolType.S2K_FO=<SrpProtocolType.S2K_FO: 's2k_fo'>
SrpProtocolType.S2K=<SrpProtocolType.S2K: 's2k'>
password_digest is None
Adding .value to the SrpPassword.xxx results in the correct password_digest result
if self.protocol == SrpProtocolType.S2K_FO.value:
...
if self.protocol == SrpProtocolType.S2K.value:
...
self.protocol='s2k'
SrpProtocolType.S2K_FO.value='s2k_fo'
SrpProtocolType.S2K.value='s2k'
password_digest = 's2k'
This works correctly if the SrpProtocol class is not used and the S2K_FO and S2K are set as constants in the srp_password.py module.
Am I doing something wrong? Or should this be looked at?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels