iPXE
Functions | Variables
certstore.h File Reference

Certificate store. More...

#include <ipxe/x509.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 FILE_SECBOOT (PERMITTED)
 
void certstore_add (struct x509_certificate *cert)
 Add certificate to store. More...
 
void certstore_del (struct x509_certificate *cert)
 Remove certificate from store. More...
 

Variables

struct x509_chain certstore
 Certificate store. More...
 

Detailed Description

Certificate store.

Definition in file certstore.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ certstore_add()

void certstore_add ( struct x509_certificate cert)

Add certificate to store.

Parameters
certX.509 certificate

Definition at line 101 of file certstore.c.

101  {
102 
103  /* Add certificate to store */
104  cert->store.cert = cert;
105  x509_get ( cert );
106  list_add ( &cert->store.list, &certstore.links );
107  DBGC ( &certstore, "CERTSTORE added certificate %s\n",
108  x509_name ( cert ) );
109 }
struct x509_chain certstore
Certificate store.
Definition: certstore.c:90
static struct x509_certificate * x509_get(struct x509_certificate *cert)
Get reference to X.509 certificate.
Definition: x509.h:267
#define list_add(new, head)
Add a new entry to the head of a list.
Definition: list.h:70
struct list_head links
List of links.
Definition: x509.h:205
#define DBGC(...)
Definition: compiler.h:505
const char * x509_name(struct x509_certificate *cert)
Get X.509 certificate display name.
Definition: x509.c:147
struct x509_link store
Link in certificate store.
Definition: x509.h:221

References x509_link::cert, certstore, DBGC, x509_chain::links, x509_link::list, list_add, x509_certificate::store, x509_get(), and x509_name().

Referenced by certstore_init(), and x509_certificate().

◆ certstore_del()

void certstore_del ( struct x509_certificate cert)

Remove certificate from store.

Parameters
certX.509 certificate

Definition at line 116 of file certstore.c.

116  {
117 
118  /* Ignore attempts to remove permanent certificates */
119  if ( cert->flags & X509_FL_PERMANENT )
120  return;
121 
122  /* Remove certificate from store */
123  DBGC ( &certstore, "CERTSTORE removed certificate %s\n",
124  x509_name ( cert ) );
125  list_del ( &cert->store.list );
126  x509_put ( cert );
127 }
struct x509_chain certstore
Certificate store.
Definition: certstore.c:90
#define DBGC(...)
Definition: compiler.h:505
unsigned int flags
Flags.
Definition: x509.h:224
#define list_del(list)
Delete an entry from a list.
Definition: list.h:120
Certificate was added at build time.
Definition: x509.h:255
const char * x509_name(struct x509_certificate *cert)
Get X.509 certificate display name.
Definition: x509.c:147
static void x509_put(struct x509_certificate *cert)
Drop reference to X.509 certificate.
Definition: x509.h:278
struct x509_link store
Link in certificate store.
Definition: x509.h:221

References certstore, DBGC, x509_certificate::flags, x509_link::list, list_del, x509_certificate::store, X509_FL_PERMANENT, x509_name(), and x509_put().

Referenced by certfree_payload(), and certstore_discard().

Variable Documentation

◆ certstore

struct x509_chain certstore