Skip to content

Commit 2c403f8

Browse files
committed
Update doc for ecdsa-sha2-nistp384 schema
Update the documentation regarding the supported older versions of the ecdsa schemas. The function documentation of securesystemslib.keys.create_signature() doesn't mention the support for the older 'ecdsa-sha2-nistp256' schema. Another problem is the comments in the code suggest we are supporting the creation of 'ecdsa-sha2-nistp384' signatures which is not true. If you read the securesystemslib.ecdsa_keys.create_signature() function you will find we only support 'ecdsa-sha2-nistp256'. Signed-off-by: Martin Vrachev <[email protected]>
1 parent 7f7c884 commit 2c403f8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

securesystemslib/keys.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,18 @@ def create_signature(key_dict, data):
611611
612612
The following signature schemes are supported:
613613
614-
'RSASSA-PSS'
614+
'rsassa-pss-(md5|sha1|sha224|sha256|sha384|sha512)'
615+
'rsa-pkcs1v15-(md5|sha1|sha224|sha256|sha384|sha512)'
615616
RFC3447 - RSASSA-PSS
616617
http://www.ietf.org/rfc/rfc3447.
617618
618619
'ed25519'
619620
ed25519 - high-speed high security signatures
620621
http://ed25519.cr.yp.to/
621622
623+
'ecdsa-sha2-nistp256'
624+
https://tools.ietf.org/html/rfc5656
625+
622626
Which signature to generate is determined by the key type of 'key_dict'
623627
and the available cryptography library specified in 'settings'.
624628
@@ -684,7 +688,7 @@ def create_signature(key_dict, data):
684688

685689
# Signing the 'data' object requires a private key. Signing schemes that are
686690
# currently supported are: 'ed25519', 'ecdsa-sha2-nistp256',
687-
# 'ecdsa-sha2-nistp384' and rsa schemes defined in
691+
# and rsa schemes defined in
688692
# `securesystemslib.keys.RSA_SIGNATURE_SCHEMES`.
689693
# RSASSA-PSS and RSA-PKCS1v15 keys and signatures can be generated and
690694
# verified by rsa_keys.py, and Ed25519 keys by PyNaCl and PyCA's
@@ -713,9 +717,9 @@ def create_signature(key_dict, data):
713717
sig, scheme = securesystemslib.ed25519_keys.create_signature(
714718
public, private, data, scheme)
715719

716-
# Continue to support keytypes of ecdsa-sha2-nistp256 and ecdsa-sha2-nistp384
720+
# Continue to support keytypes of ecdsa-sha2-nistp256
717721
# for backwards compatibility with older securesystemslib releases
718-
elif keytype in ['ecdsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384']:
722+
elif keytype in ['ecdsa', 'ecdsa-sha2-nistp256',]:
719723
sig, scheme = securesystemslib.ecdsa_keys.create_signature(
720724
public, private, data, scheme)
721725

0 commit comments

Comments
 (0)