mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Merge pull request #2078 from alex/ssh-load-coverage
Improvemed branch coverage for ssh public key loading
This commit is contained in:
commit
7e1fc28ded
2 changed files with 6 additions and 8 deletions
|
|
@ -685,8 +685,7 @@ class Backend(object):
|
|||
|
||||
def generate_dsa_parameters(self, key_size):
|
||||
if key_size not in (1024, 2048, 3072):
|
||||
raise ValueError(
|
||||
"Key size must be 1024 or 2048 or 3072 bits.")
|
||||
raise ValueError("Key size must be 1024 or 2048 or 3072 bits.")
|
||||
|
||||
if (self._lib.OPENSSL_VERSION_NUMBER < 0x1000000f and
|
||||
key_size > 1024):
|
||||
|
|
|
|||
|
|
@ -106,12 +106,11 @@ def _load_ssh_ecdsa_public_key(expected_key_type, decoded_data, backend):
|
|||
if rest:
|
||||
raise ValueError('Key body contains extra bytes.')
|
||||
|
||||
if curve_name == b"nistp256":
|
||||
curve = ec.SECP256R1()
|
||||
elif curve_name == b"nistp384":
|
||||
curve = ec.SECP384R1()
|
||||
elif curve_name == b"nistp521":
|
||||
curve = ec.SECP521R1()
|
||||
curve = {
|
||||
b"nistp256": ec.SECP256R1,
|
||||
b"nistp384": ec.SECP384R1,
|
||||
b"nistp521": ec.SECP521R1,
|
||||
}[curve_name]()
|
||||
|
||||
if six.indexbytes(data, 0) != 4:
|
||||
raise NotImplementedError(
|
||||
|
|
|
|||
Loading…
Reference in a new issue