extended credential_set_t interface by a cache_cert() method
allows persistent or in-memory caching of fetched certificates
This commit is contained in:
@@ -144,6 +144,7 @@ med_db_creds_t *med_db_creds_create(database_t *db)
|
||||
this->public.set.create_cert_enumerator = (void*)create_cert_enumerator;
|
||||
this->public.set.create_shared_enumerator = (void*)return_null;
|
||||
this->public.set.create_cdp_enumerator = (void*)return_null;
|
||||
this->public.set.cache_cert = (void*)nop;
|
||||
|
||||
this->public.destroy = (void (*)(med_db_creds_t*))destroy;
|
||||
|
||||
|
||||
@@ -331,6 +331,14 @@ static enumerator_t* create_shared_enumerator(private_sql_cred_t *this,
|
||||
return &e->public;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of credential_set_t.cache_cert.
|
||||
*/
|
||||
static void cache_cert(private_sql_cred_t *this, certificate_t *cert)
|
||||
{
|
||||
/* TODO: implement CRL caching to database */
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of sql_cred_t.destroy.
|
||||
*/
|
||||
@@ -338,7 +346,6 @@ static void destroy(private_sql_cred_t *this)
|
||||
{
|
||||
free(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Described in header.
|
||||
*/
|
||||
@@ -350,6 +357,7 @@ sql_cred_t *sql_cred_create(database_t *db)
|
||||
this->public.set.create_cert_enumerator = (void*)create_cert_enumerator;
|
||||
this->public.set.create_shared_enumerator = (void*)create_shared_enumerator;
|
||||
this->public.set.create_cdp_enumerator = (void*)return_null;
|
||||
this->public.set.cache_cert = (void*)cache_cert;
|
||||
this->public.destroy = (void(*)(sql_cred_t*))destroy;
|
||||
|
||||
this->db = db;
|
||||
|
||||
@@ -304,6 +304,14 @@ static enumerator_t* create_shared_enumerator(private_stroke_cred_t *this,
|
||||
(void*)shared_data_destroy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of credential_set_t.cache_cert.
|
||||
*/
|
||||
static void cache_cert(private_stroke_cred_t *this, certificate_t *cert)
|
||||
{
|
||||
/* TODO: implement crl writeback to ipsec.d/crls */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a certificate to chain
|
||||
*/
|
||||
@@ -868,6 +876,7 @@ stroke_cred_t *stroke_cred_create()
|
||||
this->public.set.create_private_enumerator = (void*)create_private_enumerator;
|
||||
this->public.set.create_cert_enumerator = (void*)create_cert_enumerator;
|
||||
this->public.set.create_shared_enumerator = (void*)create_shared_enumerator;
|
||||
this->public.set.cache_cert = (void*)cache_cert;
|
||||
this->public.set.create_cdp_enumerator = (void*)return_null;
|
||||
this->public.reread = (void(*)(stroke_cred_t*, stroke_msg_t *msg))reread;
|
||||
this->public.load_ca = (certificate_t*(*)(stroke_cred_t*, char *filename))load_ca;
|
||||
|
||||
Reference in New Issue
Block a user