Rename psa_asymmetric_{sign_verify} to psa_{sign,verify}_hash #325
No reviewers
Labels
No labels
api-spec
bug
CLA requested
CLA valid
compliance
DO NOT MERGE
duplicate
enhancement
feature branch
good first issue
HEADER FORMATTING ISSUE
help wanted
Information
invalid
Jira status: AWAITING REVIEW
Jira status: CLOSED
Jira status: DONE
Jira status: IN PROGRESS
Jira status: IN REVIEW
Jira status: OPEN
Jira status: REOPENED
Jira status: RESOLVED
mirrored
mirror internally
needs: backports
needs: ci
needs: design review
needs: preceding PR
needs: review
needs: work
notabug
open for community contribution
Product Backlog
question
ready for merge
security
stale
type: bug
type: enhancement
type: question
web pages
wontfix
writing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-ARMmbed/mbed-crypto!325
Loading…
Reference in a new issue
No description provided.
Delete branch "psa-sign_hash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rename
psa_asymmetric_signtopsa_sign_hashto make it clearer that this function takes a hash as its input (or something that serves as a hash). Likewise forpsa_asymmetric_verifytopsa_verify_hash. Rename some macros accordingly. A follow-up will add a new pair of functionspsa_sign_messageandpsa_verify_message.Keep deprecated aliases. Improve the testing of deprecated features: do test some deprecated features when
MBEDTLS_DEPRECATED_REMOVEDandMBEDTLS_DEPRECATED_WARNINGare both disabled, and add a test component that builds and runs with those tests andMBEDTLS_DEPRECATED_WARNINGenabled and with-Werror=deprecated-declarationsdisabled.This enacts a change in the PSA specification (private link: https://github.com/ARMmbed/psa-crypto/pull/301). Internal ref: IOTCRYPT-933
CI passed except for expected failures: an ABI change (two external symbols have been renamed) and generated files in TLS (due to the new header).
@ -0,0 +1,109 @@/*** \file psa/crypto_compat.h** \brief PSA cryptography module: Backward compatibility aliasesI would add a sentence about this file also having deprecation information.
PSA_ASYMMETRIC_SIGN_OUTPUT_SIZEis still used in test_suite_psa_crypto.function.@ -3931,2 +3993,4 @@TEST_EQUAL( actual_status, expected_status );#if defined(MBEDTLS_TEST_DEPRECATED)TEST_EQUAL( psa_asymmetric_verify( handle, alg,This is conditioned by
MBEDTLS_TEST_DEPRECATED. Using a deprecated macro outside of aMBEDTLS_TEST_DEPRECATEDguard should result in a CI failure in the job withMBEDTLS_DEPRECATED_WARNINGset.@ -0,0 +1,109 @@/*** \file psa/crypto_compat.h** \brief PSA cryptography module: Backward compatibility aliasesWhat do you mean? Something like “This header declares alternative names for macros and functions that may be removed in a future version of Mbed Crypto”?
I was thinking about a potential gap in testing deprecated stuff here:
If
psa_asymmetric_signsomehow happens to returnPSA_SUCCESSon error, but doesn't modifysignaturein the process, the nextASSERT_COMPAREwill succeed anyway, since there's old data in the buffer.Not sure if it's worth to add buffer zeroization here, since
psa_asymmetric_signshould not behave badly.I don't think it's useful to test deprecated identifiers as black boxes. My intent was a gray-box test, where we assume that the deprecated identifiers are defined as aliases but they may be defined as the wrong alias, or pass the wrong parameter, or have syntax errors in a macro expansion. Zeroing
signaturehere is cheap and useful so I'll do it.@ -0,0 +1,109 @@/*** \file psa/crypto_compat.h** \brief PSA cryptography module: Backward compatibility aliasesOr just
Backward compatibility aliases and deprecated entitiesI've verified that the renamed entities are not used across the library (apart from
crypto_compatand deprecation tests). The changes look fine.Again CI (head, merge) passed except for expected failures: an ABI change (two external symbols have been renamed) and generated files in TLS (due to the new header).