mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
efi_loader: signature: rework for intermediate certificates support
In this commit, efi_signature_verify(with_sigdb) will be re-implemented using pcks7_verify_one() in order to support certificates chain, where the signer's certificate will be signed by an intermediate CA (certificate authority) and the latter's certificate will also be signed by another CA and so on. What we need to do here is to search for certificates in a signature, build up a chain of certificates and verify one by one. pkcs7_verify_one() handles most of these steps except the last one. pkcs7_verify_one() returns, if succeeded, the last certificate to verify, which can be either a self-signed one or one that should be signed by one of certificates in "db". Re-worked efi_signature_verify() will take care of this step. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
This commit is contained in:
parent
0658bb29b0
commit
1115edd846
5 changed files with 190 additions and 215 deletions
|
@ -253,12 +253,11 @@ static efi_status_t efi_variable_authenticate(u16 *variable,
|
|||
}
|
||||
|
||||
/* verify signature */
|
||||
if (efi_signature_verify_with_sigdb(regs, var_sig, truststore, NULL)) {
|
||||
if (efi_signature_verify(regs, var_sig, truststore, NULL)) {
|
||||
EFI_PRINT("Verified\n");
|
||||
} else {
|
||||
if (truststore2 &&
|
||||
efi_signature_verify_with_sigdb(regs, var_sig,
|
||||
truststore2, NULL)) {
|
||||
efi_signature_verify(regs, var_sig, truststore2, NULL)) {
|
||||
EFI_PRINT("Verified\n");
|
||||
} else {
|
||||
EFI_PRINT("Verifying variable's signature failed\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue