mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-05-01 08:36:17 +00:00
psa_constant_names: fix display for truncated unknown MAC/AEAD algorithm
This commit is contained in:
parent
c68ce9637a
commit
182c2e9836
|
@ -62,7 +62,10 @@ static int psa_snprint_algorithm(char *buffer, size_t buffer_size,
|
||||||
}
|
}
|
||||||
} else if (PSA_ALG_IS_AEAD(alg)) {
|
} else if (PSA_ALG_IS_AEAD(alg)) {
|
||||||
core_alg = PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(alg);
|
core_alg = PSA_ALG_AEAD_WITH_DEFAULT_TAG_LENGTH(alg);
|
||||||
if (core_alg != alg) {
|
if (core_alg == 0) {
|
||||||
|
/* For unkonwn AEAD algorithms, there is no "default tag length". */
|
||||||
|
core_alg = alg;
|
||||||
|
} else if (core_alg != alg) {
|
||||||
append(&buffer, buffer_size, &required_size,
|
append(&buffer, buffer_size, &required_size,
|
||||||
"PSA_ALG_AEAD_WITH_TAG_LENGTH(", 29);
|
"PSA_ALG_AEAD_WITH_TAG_LENGTH(", 29);
|
||||||
length_modifier = PSA_AEAD_TAG_LENGTH(alg);
|
length_modifier = PSA_AEAD_TAG_LENGTH(alg);
|
||||||
|
@ -73,7 +76,7 @@ static int psa_snprint_algorithm(char *buffer, size_t buffer_size,
|
||||||
default:
|
default:
|
||||||
%(algorithm_code)s{
|
%(algorithm_code)s{
|
||||||
append_integer(&buffer, buffer_size, &required_size,
|
append_integer(&buffer, buffer_size, &required_size,
|
||||||
"0x%%08lx", (unsigned long) alg);
|
"0x%%08lx", (unsigned long) core_alg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue