add a hx509_context where we can store configuration

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16476 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-01-04 20:33:31 +00:00
parent d5e17d6541
commit 7dcf3289bb
16 changed files with 456 additions and 310 deletions

View File

@@ -53,7 +53,7 @@ hx509_lock _hx509_empty_lock = &empty_lock_data;
*/
int
hx509_lock_init(hx509_lock *lock)
hx509_lock_init(hx509_context context, hx509_lock *lock)
{
hx509_lock l;
int ret;
@@ -64,7 +64,11 @@ hx509_lock_init(hx509_lock *lock)
if (l == NULL)
return ENOMEM;
ret = hx509_certs_init("MEMORY:locks-internal", 0, NULL, &l->certs);
ret = hx509_certs_init(context,
"MEMORY:locks-internal",
0,
NULL,
&l->certs);
if (ret) {
free(l);
return ret;
@@ -122,24 +126,28 @@ hx509_lock_reset_passwords(hx509_lock lock)
}
int
hx509_lock_add_cert(hx509_lock lock, hx509_cert cert)
hx509_lock_add_cert(hx509_context context, hx509_lock lock, hx509_cert cert)
{
return hx509_certs_add(lock->certs, cert);
return hx509_certs_add(context, lock->certs, cert);
}
int
hx509_lock_add_certs(hx509_lock lock, hx509_certs certs)
hx509_lock_add_certs(hx509_context context, hx509_lock lock, hx509_certs certs)
{
return hx509_certs_merge(lock->certs, certs);
return hx509_certs_merge(context, lock->certs, certs);
}
void
hx509_lock_reset_certs(hx509_lock lock)
hx509_lock_reset_certs(hx509_context context, hx509_lock lock)
{
hx509_certs certs = lock->certs;
int ret;
ret = hx509_certs_init("MEMORY:locks-internal", 0, NULL, &lock->certs);
ret = hx509_certs_init(context,
"MEMORY:locks-internal",
0,
NULL,
&lock->certs);
if (ret == 0)
hx509_certs_free(&certs);
else