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)
 
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  )

◆ certstore_add()

void certstore_add ( struct x509_certificate cert)

Add certificate to store.

Parameters
certX.509 certificate

Definition at line 100 of file certstore.c.

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

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 115 of file certstore.c.

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

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