1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

rsa: add support of padding pss

We add the support of the padding pss for rsa signature.
This new padding is often recommended instead of pkcs-1.5.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Philippe Reynes
2018-11-14 13:51:01 +01:00
committed by Tom Rini
parent 20031567e1
commit 061daa0b61
6 changed files with 230 additions and 0 deletions

View File

@@ -438,6 +438,16 @@ static int rsa_sign_with_key(RSA *rsa, struct padding_algo *padding_algo,
goto err_sign;
}
#ifdef CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT
if (padding_algo && !strcmp(padding_algo->name, "pss")) {
if (EVP_PKEY_CTX_set_rsa_padding(ckey,
RSA_PKCS1_PSS_PADDING) <= 0) {
ret = rsa_err("Signer padding setup failed");
goto err_sign;
}
}
#endif /* CONFIG_FIT_ENABLE_RSASSA_PSS_SUPPORT */
for (i = 0; i < region_count; i++) {
if (!EVP_DigestSignUpdate(context, region[i].data,
region[i].size)) {