Alternative to mem_cred_t.add_cert added, which returns the certificate.

If the certificate is already cached, the cached version is returned.
This commit is contained in:
Tobias Brunner
2010-12-03 17:59:59 +01:00
parent 3023a75e67
commit 68c7f18643
2 changed files with 40 additions and 4 deletions
@@ -46,6 +46,17 @@ struct mem_cred_t {
*/
void (*add_cert)(mem_cred_t *this, bool trusted, certificate_t *cert);
/**
* Add a certificate to the credential set, returning a reference to it or
* to a cached duplicate.
*
* @param trusted TRUE to serve certificate as trusted
* @param cert certificate, reference gets owned by set
* @return reference to cert or a previously cached duplicate
*/
certificate_t *(*add_cert_ref)(mem_cred_t *this, bool trusted,
certificate_t *cert);
/**
* Add a private key to the credential set.
*