Validate the PKCS#7 trust chain against the contents of the system keyring.
Signed-off-by: David Howells <dhowells@redhat.com>
tristate "PE binary-wrapped key parser"
depends on X509_CERTIFICATE_PARSER
depends on PKCS7_MESSAGE_PARSER
+ depends on SYSTEM_TRUSTED_KEYRING
help
This option provides support for parsing signed PE binaries that
contain an X.509 certificate in an internal section.
#include <linux/asn1.h>
#include <keys/asymmetric-subtype.h>
#include <keys/asymmetric-parser.h>
+#include <keys/system_keyring.h>
#include <crypto/hash.h>
#include "asymmetric_keys.h"
#include "public_key.h"
if (ret < 0)
goto error;
+ ret = pkcs7_validate_trust(pkcs7, system_trusted_keyring, &prep->trusted);
+ if (ret < 0)
+ goto error;
+
ret = -ENOANO; // Not yet complete
error: