[x509] Make root of trust a reference-counted structure

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2020-12-09 16:19:03 +00:00
parent e3eedb0be5
commit 3475f9162b
7 changed files with 81 additions and 14 deletions

View File

@@ -1317,6 +1317,7 @@ static struct x509_chain empty_store = {
/** Root certificate list containing the iPXE self-test root CA */
static struct x509_root test_root = {
.refcnt = REF_INIT ( ref_no_free ),
.digest = &cms_test_algorithm,
.count = 1,
.fingerprints = root_crt_fingerprint,
@@ -1331,6 +1332,7 @@ static uint8_t dummy_fingerprint[] =
/** Certificate store containing a dummy fingerprint */
static struct x509_root dummy_root = {
.refcnt = REF_INIT ( ref_no_free ),
.digest = &cms_test_algorithm,
.count = 1,
.fingerprints = dummy_fingerprint,

View File

@@ -674,6 +674,7 @@ static struct x509_chain empty_store = {
/** Root certificate list containing the iPXE self-test root CA */
static struct x509_root test_root = {
.refcnt = REF_INIT ( ref_no_free ),
.digest = &x509_test_algorithm,
.count = 1,
.fingerprints = root_crt_fingerprint,
@@ -681,6 +682,7 @@ static struct x509_root test_root = {
/** Root certificate list containing the iPXE self-test intermediate CA */
static struct x509_root intermediate_root = {
.refcnt = REF_INIT ( ref_no_free ),
.digest = &x509_test_algorithm,
.count = 1,
.fingerprints = intermediate_crt_fingerprint,
@@ -695,6 +697,7 @@ static uint8_t dummy_fingerprint[] =
/** Certificate store containing a dummy fingerprint */
static struct x509_root dummy_root = {
.refcnt = REF_INIT ( ref_no_free ),
.digest = &x509_test_algorithm,
.count = 1,
.fingerprints = dummy_fingerprint,