mbedtls/library
Gilles Peskine f7b4137e69 Untangle PSA_ALG_IS_HASH_AND_SIGN and PSA_ALG_IS_SIGN_HASH
The current definition of PSA_ALG_IS_HASH_AND_SIGN includes
PSA_ALG_RSA_PKCS1V15_SIGN_RAW and PSA_ALG_ECDSA_ANY, which don't strictly
follow the hash-and-sign paradigm: the algorithm does not encode a hash
algorithm that is applied prior to the signature step. The definition in
fact encompasses what can be used with psa_sign_hash/psa_verify_hash, so
it's the correct definition for PSA_ALG_IS_SIGN_HASH. Therefore this commit
moves definition of PSA_ALG_IS_HASH_AND_SIGN to PSA_ALG_IS_SIGN_HASH, and
replace the definition of PSA_ALG_IS_HASH_AND_SIGN by a correct one (based
on PSA_ALG_IS_SIGN_HASH, excluding the algorithms where the pre-signature
step isn't to apply the hash encoded in the algorithm).

In the definition of PSA_ALG_SIGN_GET_HASH, keep the condition for a nonzero
output to be PSA_ALG_IS_HASH_AND_SIGN.

Everywhere else in the code base (definition of PSA_ALG_IS_SIGN_MESSAGE, and
every use of PSA_ALG_IS_HASH_AND_SIGN outside of crypto_values.h), we meant
PSA_ALG_IS_SIGN_HASH where we wrote PSA_ALG_IS_HASH_AND_SIGN, so do a
global replacement.
```
git grep -l IS_HASH_AND_SIGN ':!include/psa/crypto_values.h' | xargs perl -i -pe 's/ALG_IS_HASH_AND_SIGN/ALG_IS_SIGN_HASH/g'
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-11-03 15:48:15 +01:00
..
.gitignore
aes.c
aesni.c
aesni.h
aria.c
asn1parse.c
asn1write.c
base64_invasive.h
base64.c
bignum.c
bn_mul.h
camellia.c
ccm.c
chacha20.c
chachapoly.c
check_crypto_config.h
cipher_wrap.c
cipher_wrap.h
cipher.c
cmac.c
CMakeLists.txt
common.h fix wrong para name in doxygen comments 2021-10-28 10:26:13 +08:00
ctr_drbg.c
debug.c
des.c
dhm.c
ecdh_misc.h
ecdh.c
ecdsa.c
ecjpake.c
ecp_curves.c
ecp_internal_alt.h
ecp_invasive.h
ecp.c
entropy_poll.c
entropy_poll.h
entropy.c
gcm.c
hkdf.c
hmac_drbg.c
Makefile
md5.c
md_wrap.h
md.c
memory_buffer_alloc.c
mps_common.h
mps_error.h
mps_reader.c
mps_reader.h
mps_trace.c
mps_trace.h
net_sockets.c
nist_kw.c
oid.c
padlock.c
padlock.h
pem.c
pk_wrap.c
pk_wrap.h
pk.c
pkcs5.c
pkcs12.c
pkparse.c
pkwrite.c
platform_util.c
platform.c
poly1305.c
psa_crypto_aead.c
psa_crypto_aead.h
psa_crypto_cipher.c
psa_crypto_cipher.h
psa_crypto_client.c
psa_crypto_core.h
psa_crypto_driver_wrappers.c
psa_crypto_driver_wrappers.h
psa_crypto_ecp.c
psa_crypto_ecp.h
psa_crypto_hash.c
psa_crypto_hash.h
psa_crypto_invasive.h
psa_crypto_its.h
psa_crypto_mac.c Use the new macro PSA_HASH_BLOCK_LENGTH 2021-11-03 15:47:03 +01:00
psa_crypto_mac.h
psa_crypto_random_impl.h
psa_crypto_rsa.c
psa_crypto_rsa.h
psa_crypto_se.c
psa_crypto_se.h
psa_crypto_slot_management.c
psa_crypto_slot_management.h
psa_crypto_storage.c
psa_crypto_storage.h
psa_crypto.c Untangle PSA_ALG_IS_HASH_AND_SIGN and PSA_ALG_IS_SIGN_HASH 2021-11-03 15:48:15 +01:00
psa_its_file.c
ripemd160.c
rsa_alt_helpers.c
rsa_alt_helpers.h
rsa.c
sha1.c
sha256.c
sha512.c
ssl_cache.c
ssl_ciphersuites.c
ssl_cli.c Refactor elliptic curve extension for NamedGroups 2021-10-29 14:07:46 +01:00
ssl_cookie.c
ssl_invasive.h
ssl_misc.h Merge pull request #4859 from brett-warren-arm/supported_groups 2021-11-02 10:49:09 +01:00
ssl_msg.c
ssl_srv.c Refactor elliptic curve extension for NamedGroups 2021-10-29 14:07:46 +01:00
ssl_ticket.c
ssl_tls13_client.c Merge pull request #4859 from brett-warren-arm/supported_groups 2021-11-02 10:49:09 +01:00
ssl_tls13_generic.c fix some format issues 2021-10-29 02:39:30 +00:00
ssl_tls13_keys.c
ssl_tls13_keys.h
ssl_tls13_server.c
ssl_tls.c Add mbedtls_ssl_conf_groups to API 2021-10-29 11:27:00 +01:00
threading.c
timing.c
version.c
x509_create.c
x509_crl.c
x509_crt.c
x509_csr.c
x509.c
x509write_crt.c
x509write_csr.c