use credential builder to build attribute certificates

This commit is contained in:
Martin Willi
2009-08-26 11:23:49 +02:00
parent a5dc4a9585
commit 37f5a0da2c
2 changed files with 82 additions and 17 deletions
+7 -13
View File
@@ -36,6 +36,7 @@
#include "log.h"
#include "whack.h"
#include "fetch.h"
#include "builder.h"
/**
* Chained list of X.509 attribute certificates
@@ -818,20 +819,13 @@ void load_acerts(void)
{
while (n--)
{
chunk_t blob = chunk_empty;
bool pgp = FALSE;
if (load_coded_file(filelist[n]->d_name, NULL, "acert", &blob, &pgp))
x509acert_t *ac;
ac = lib->creds->create(lib->creds, CRED_PLUTO_CERT, CRED_TYPE_AC,
BUILD_FROM_FILE, filelist[n]->d_name, BUILD_END);
if (ac)
{
x509acert_t *ac = malloc_thing(x509acert_t);
*ac = empty_ac;
if (parse_ac(blob, ac)
&& verify_x509acert(ac, FALSE))
add_acert(ac);
else
free_acert(ac);
add_acert(ac);
}
free(filelist[n]);
}