Skip to content

Commit

Permalink
Add ecdsa-sha2-nistp384 support to keys.verify_sig
Browse files Browse the repository at this point in the history
Support nistp384 in addition to nistp256 in the
public keys.verify_signature interface.

Note: This commit tries to blend in with the current sslib design.
In future work we should:
- define securesystemslib-wide constants instead of hardcoding
  strings over and over again (see item 3 in #183)
- re-think "key type" vs. "signature scheme"
  • Loading branch information
lukpueh committed Apr 6, 2020
1 parent 3e8a3d9 commit efe9afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions securesystemslib/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,8 @@ def verify_signature(key_dict, signature, data):
raise securesystemslib.exceptions.UnsupportedAlgorithmError('Unsupported'
' signature scheme is specified: ' + repr(scheme))

elif keytype == 'ecdsa-sha2-nistp256':
if scheme == 'ecdsa-sha2-nistp256':
elif keytype in ['ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384']:
if scheme in ['ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384']:
valid_signature = securesystemslib.ecdsa_keys.verify_signature(public,
scheme, sig, data)

Expand Down

0 comments on commit efe9afe

Please sign in to comment.