46#define CERT( _index, _path ) \
47 extern char stored_cert_ ## _index ## _data[]; \
48 extern size_t ABS_SYMBOL ( stored_cert_ ## _index ## _len ); \
49 __asm__ ( ".section \".rodata\", \"a\", " PROGBITS "\n\t" \
50 "\nstored_cert_" #_index "_data:\n\t" \
51 ".incbin \"" _path "\"\n\t" \
52 "\nstored_cert_" #_index "_end:\n\t" \
53 ".equ stored_cert_" #_index "_len, " \
54 "( stored_cert_" #_index "_end - " \
55 " stored_cert_" #_index "_data )\n\t" \
61#define CERT( _index, _path ) { \
62 .data = stored_cert_ ## _index ## _data, \
63 .len = ABS_VALUE_INIT ( stored_cert_ ## _index ## _len ), \
85 DBGC2 (
store,
"CERTSTORE found certificate %s\n",
187 "is a duplicate of %s\n", i,
x509_name ( cert ));
196 "permanent certificate %d: %s\n",
207 DBGC ( &
certstore,
"CERTSTORE permanent certificate %d is %s\n",
221 .description =
"Certificate",
223 .type = &setting_type_hex,
244 &cert_data ) ) >= 0 ) {
247 "certificate %s\n",
x509_name ( cert ) );
250 "additional certificate: %s\n",
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
static void certstore_init(void)
Construct permanent certificate store.
void certstore_del(struct x509_certificate *cert)
Remove certificate from store.
static unsigned int certstore_discard(void)
Discard a stored certificate.
static int certstore_apply_settings(void)
Apply certificate store configuration settings.
static void certstore_found(struct x509_chain *store, struct x509_certificate *cert)
Mark stored certificate as most recently used.
void certstore_add(struct x509_certificate *cert)
Add certificate to store.
static struct asn1_cursor certstore_raw[]
struct x509_chain certstore
Certificate store.
static struct x509_certificate certstore_certs[sizeof(certstore_raw)/sizeof(certstore_raw[0])]
X.509 certificate structures for all permanent stored certificates.
#define CACHE_NORMAL
Items with a normal replacement cost.
#define DHCP_EB_CERT
Client certficate.
#define INIT_LATE
Late initialisation.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define REQUIRE_OBJECT(object)
Require an object.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define SETTING_CRYPTO
Cryptography settings.
#define REQUIRING_SYMBOL(symbol)
Specify the file's requiring symbol.
Dynamic Host Configuration Protocol.
#define __setting(setting_order, name)
Declare a configuration setting.
#define __settings_applicator
Declare a settings applicator.
#define __init_fn(init_order)
Declare an initialisation functon.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
#define list_del(list)
Delete an entry from a list.
#define list_for_each_entry_reverse(pos, head, member)
Iterate over entries in a list in reverse order.
#define list_add(new, head)
Add a new entry to the head of a list.
Dynamic memory allocation.
#define __cache_discarder(cost)
Declare a cache discarder.
void ref_no_free(struct refcnt *refcnt __unused)
Do not free reference-counted object.
static void(* free)(struct refcnt *refcnt))
#define REF_INIT(free_fn)
Initialise a static reference counter.
#define ref_init(refcnt, free)
Initialise a reference counter.
int fetch_raw_setting_copy(struct settings *settings, const struct setting *setting, void **data)
Fetch value of setting.
char * strerror(int errno)
Retrieve string representation of error number.
An initialisation function.
int count
Current reference count.
struct refcnt refcnt
Reference count.
struct x509_link store
Link in certificate store.
An X.509 certificate chain.
struct list_head list
List of links.
struct x509_certificate * cert
Certificate.
int x509_parse(struct x509_certificate *cert, const struct asn1_cursor *raw)
Parse X.509 certificate from ASN.1 data.
struct x509_certificate * x509_find(struct x509_chain *store, const struct asn1_cursor *raw)
Identify X.509 certificate by raw certificate data.
const char * x509_name(struct x509_certificate *cert)
Get X.509 certificate display name.
static struct x509_certificate * x509_get(struct x509_certificate *cert)
Get reference to X.509 certificate.
static void x509_put(struct x509_certificate *cert)
Drop reference to X.509 certificate.
@ X509_FL_EXPLICIT
Certificate was added explicitly at run time.
@ X509_FL_PERMANENT
Certificate was added at build time.