vici: Keep track of all CA certificates in vici_authority_t
This way we only have one reference for each CA certificate, whether it is loaded in an authority section, a connection or via load-certs() command. It also avoids enumerating CA certificates multiple times if they are loaded in different ways.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Tobias Brunner
|
||||
* Copyright (C) 2015 Andreas Steffen
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
@@ -22,7 +23,6 @@
|
||||
#define VICI_AUTHORITY_H_
|
||||
|
||||
#include "vici_dispatcher.h"
|
||||
#include "vici_cred.h"
|
||||
|
||||
typedef struct vici_authority_t vici_authority_t;
|
||||
|
||||
@@ -36,6 +36,20 @@ struct vici_authority_t {
|
||||
*/
|
||||
credential_set_t set;
|
||||
|
||||
/**
|
||||
* Add a CA certificate and return a reference if it is already stored,
|
||||
* otherwise returns the same certificate.
|
||||
*
|
||||
* @param cert certificate to check
|
||||
* @return reference to stored CA certificate, or original
|
||||
*/
|
||||
certificate_t *(*add_ca_cert)(vici_authority_t *this, certificate_t *cert);
|
||||
|
||||
/**
|
||||
* Remove CA certificates added via add_ca_cert().
|
||||
*/
|
||||
void (*clear_ca_certs)(vici_authority_t *this);
|
||||
|
||||
/**
|
||||
* Destroy a vici_authority_t.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user