summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2023-09-18 11:30:18 +0200
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2023-09-18 11:30:18 +0200
commitdbfafc5e7e64fa29216ad815eac0f714574ec654 (patch)
tree12e94abb40d39f744eb2f0504daf1310cf87aa3c
parentcc933e1d12f55f3d9efd14ae2a29c5648a3ccf08 (diff)
parent1046b41808b23b4079f04cad370646e05207ded5 (diff)
Merge "fix(auth): don't overwrite pk with converted pk when rotpk is hash" into integration
-rw-r--r--drivers/auth/auth_mod.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/auth/auth_mod.c b/drivers/auth/auth_mod.c
index 105dc054f..14c3172c9 100644
--- a/drivers/auth/auth_mod.c
+++ b/drivers/auth/auth_mod.c
@@ -150,8 +150,8 @@ static int auth_signature(const auth_method_param_sig_t *param,
const auth_img_desc_t *img_desc,
void *img, unsigned int img_len)
{
- void *data_ptr, *pk_ptr, *pk_plat_ptr, *sig_ptr, *sig_alg_ptr, *pk_oid;
- unsigned int data_len, pk_len, pk_plat_len, sig_len, sig_alg_len;
+ void *data_ptr, *pk_ptr, *cnv_pk_ptr, *pk_plat_ptr, *sig_ptr, *sig_alg_ptr, *pk_oid;
+ unsigned int data_len, pk_len, cnv_pk_len, pk_plat_len, sig_len, sig_alg_len;
unsigned int flags = 0;
int rc = 0;
@@ -210,14 +210,14 @@ static int auth_signature(const auth_method_param_sig_t *param,
* platform may store the hash of a prefixed,
* suffixed or modified pk
*/
- rc = crypto_mod_convert_pk(pk_ptr, pk_len, &pk_ptr, &pk_len);
+ rc = crypto_mod_convert_pk(pk_ptr, pk_len, &cnv_pk_ptr, &cnv_pk_len);
return_if_error(rc);
/*
* The hash of the certificate's public key must match
* the hash of the ROTPK.
*/
- rc = crypto_mod_verify_hash(pk_ptr, pk_len,
+ rc = crypto_mod_verify_hash(cnv_pk_ptr, cnv_pk_len,
pk_plat_ptr, pk_plat_len);
return_if_error(rc);
} else {