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
Spec only defines Crypto_Sign(privateKey, message) primitive
CASE and all other areas where signatures are generated according to the spec use the message variant
The sign_hash operation is a low-level consideration of crypto APIs and is sometimes not exposed by platform crypto APIs. For example, in Java's java.security.Signature, including on Android, there is no way to get a signature by providing a pre-computed digest. The API expects digesting to be done by the signing operation.
Overall, replacement of this primitive is trivial wherever used, and would reduce reliance on native implementation that prevent going to hardware/OS-aided key storage, especially where Java is concerned.
Proposed Solution
Mark ECDSA_sign_hash as deprecated
Replace usages of ECDSA_sign_hash with ECDSA_sign_message where possible
The text was updated successfully, but these errors were encountered:
ECDSA_sign_hash and ECDSA_validate_hash_signature are useful in various scenarios such as signing non-contiguous memory blocks without the need to concatenate them all into one, e.g. during firmware update. The Java equivalent is NONEwithECDSA.
- The ECDSA_sign_hash method is a near identical copy of of ECDSA_sign_msg,
that takes a raw hash.
- This is problematic since some platforms, like Android, cannot directly sign
a pre-computed hash with OS-aided APIs, and overall this is not consistent
with signature APIs that work on messages, and where a digest is an internal
implementation detail.
- Overall, the method adds little value and prevents easy transition to different
signing algorithms over time if the hash assumption is kept
Fixesproject-chip#18430
This PR:
- Removes the sign_hash API
- Replaces its usage throughout the SDK
- Updates all tests
- Leaves the ECDSA_verify_hash_signature (since it's only used in one place,
already in native code, and always against raw public keys)
Testing done:
- Cert tests still pass, including device attestation during commissioning
- Unit tests still pass including updated unit tests
* Remove duplicate P256Keypair::ECDSA_sign_hash code
- The ECDSA_sign_hash method is a near identical copy of of ECDSA_sign_msg,
that takes a raw hash.
- This is problematic since some platforms, like Android, cannot directly sign
a pre-computed hash with OS-aided APIs, and overall this is not consistent
with signature APIs that work on messages, and where a digest is an internal
implementation detail.
- Overall, the method adds little value and prevents easy transition to different
signing algorithms over time if the hash assumption is kept
Fixes#18430
This PR:
- Removes the sign_hash API
- Replaces its usage throughout the SDK
- Updates all tests
- Leaves the ECDSA_verify_hash_signature (since it's only used in one place,
already in native code, and always against raw public keys)
Testing done:
- Cert tests still pass, including device attestation during commissioning
- Unit tests still pass including updated unit tests
* Restyled by clang-format
* Remove missed removals
* Apply review comments
Co-authored-by: Restyled.io <commits@restyled.io>
Problem
Crypto_Sign(privateKey, message)
primitivejava.security.Signature
, including on Android, there is no way to get a signature by providing a pre-computed digest. The API expects digesting to be done by the signing operation.Overall, replacement of this primitive is trivial wherever used, and would reduce reliance on native implementation that prevent going to hardware/OS-aided key storage, especially where Java is concerned.
Proposed Solution
ECDSA_sign_hash
as deprecatedECDSA_sign_hash
withECDSA_sign_message
where possibleThe text was updated successfully, but these errors were encountered: