You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I detected 2 bugs referred to the KeyUsage extensions processing at CertInfo class:
The first one at line 501 when the parameter --usage is processed:
ku_args = {k: True in self.usage for k in KU_FIELDS}
Here I guess that the aim is to set True to those KU_FIELDS that are present in self.usage. Instead of that, what that line is doing is assigning False to every k because the evaluation of True in self.usage results always to False. The next line fixes it:
ku_args = {k: True if k in self.usage else False for k in KU_FIELDS }
The second one refers to the get_invalid_key_usage function inside keys.py. More specifically the line 115 tries to evaluate if we want to go UNSAFE or the pubkey is instance of rsa.RSAPublicKey:
Here what I guess is that we want to return empty tuple if the pubkey IS NOT a rsa.RSAPublicKey, because of this possible attack which you named "rsa_legacy", but I'm not complete sure about what you've tried to validate here.
The text was updated successfully, but these errors were encountered:
I detected 2 bugs referred to the KeyUsage extensions processing at CertInfo class:
--usage
is processed:ku_args = {k: True in self.usage for k in KU_FIELDS}
Here I guess that the aim is to set True to those KU_FIELDS that are present in self.usage. Instead of that, what that line is doing is assigning False to every
k
because the evaluation ofTrue in self.usage
results always to False. The next line fixes it:ku_args = {k: True if k in self.usage else False for k in KU_FIELDS }
get_invalid_key_usage
function inside keys.py. More specifically the line 115 tries to evaluate if we want to go UNSAFE or the pubkey is instance of rsa.RSAPublicKey:Here what I guess is that we want to return empty tuple if the pubkey IS NOT a rsa.RSAPublicKey, because of this possible attack which you named "rsa_legacy", but I'm not complete sure about what you've tried to validate here.
The text was updated successfully, but these errors were encountered: