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:
committed by
Tom Rini
parent
20031567e1
commit
061daa0b61
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user