iPXE
|
Cryptographic Message Syntax (PKCS #7) More...
#include <time.h>
#include <ipxe/asn1.h>
#include <ipxe/crypto.h>
#include <ipxe/x509.h>
#include <ipxe/refcnt.h>
#include <ipxe/uaccess.h>
Go to the source code of this file.
Data Structures | |
struct | cms_signer_info |
CMS signer information. More... | |
struct | cms_signature |
A CMS signature. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static struct cms_signature * | cms_get (struct cms_signature *sig) |
Get reference to CMS signature. More... | |
static void | cms_put (struct cms_signature *sig) |
Drop reference to CMS signature. More... | |
int | cms_signature (const void *data, size_t len, struct cms_signature **sig) |
Create CMS signature. More... | |
int | cms_verify (struct cms_signature *sig, userptr_t data, size_t len, const char *name, time_t time, struct x509_chain *store, struct x509_root *root) |
Verify CMS signature. More... | |
Cryptographic Message Syntax (PKCS #7)
Definition in file cms.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
|
inlinestatic |
Drop reference to CMS signature.
sig | CMS signature |
Definition at line 66 of file cms.h.
Referenced by cms_signature(), cms_test_exec(), and imgverify().
int cms_signature | ( | const void * | data, |
size_t | len, | ||
struct cms_signature ** | sig | ||
) |
Create CMS signature.
data | Raw signature data |
len | Length of raw data |
sig | CMS signature |
rc | Return status code |
On success, the caller holds a reference to the CMS signature, and is responsible for ultimately calling cms_put().
Definition at line 492 of file cms.c.
References asn1_shrink_any(), cms_free(), cms_parse(), cms_put(), asn1_cursor::data, data, ENOMEM, INIT_LIST_HEAD, len, asn1_cursor::len, rc, ref_init, sig, x509_alloc_chain(), and zalloc().
int cms_verify | ( | struct cms_signature * | sig, |
userptr_t | data, | ||
size_t | len, | ||
const char * | name, | ||
time_t | time, | ||
struct x509_chain * | store, | ||
struct x509_root * | root | ||
) |
Verify CMS signature.
sig | CMS signature |
data | Signed data |
len | Length of signed data |
name | Required common name, or NULL to check all signatures |
time | Time at which to validate certificates |
store | Certificate store, or NULL to use default |
root | Root certificate list, or NULL to use default |
rc | Return status code |
Definition at line 681 of file cms.c.
References cms_verify_signer_info(), count, data, DBGC, EACCES_NO_SIGNATURES, EACCES_WRONG_NAME, info, len, list_for_each_entry, name, rc, root, sig, x509_certificate::store, time, x509_check_name(), and x509_first().
Referenced by cms_verify_fail_okx(), cms_verify_okx(), and imgverify().