received certificates have least priority

fixed manager unlocking
This commit is contained in:
Martin Willi
2008-03-31 08:43:18 +00:00
parent d69b267d58
commit 0f7ef3d2a0
+5 -9
View File
@@ -366,9 +366,7 @@ static bool verify_ocsp(private_credential_manager_t *this,
bool verified = FALSE; bool verified = FALSE;
wrapper = ocsp_response_wrapper_create((ocsp_response_t*)response); wrapper = ocsp_response_wrapper_create((ocsp_response_t*)response);
this->sets->remove(this->sets, this->cache, NULL); this->sets->insert_last(this->sets, wrapper);
this->sets->insert_first(this->sets, wrapper);
this->sets->insert_first(this->sets, this->cache);
subject = &response->certificate; subject = &response->certificate;
responder = subject->get_issuer(subject); responder = subject->get_issuer(subject);
@@ -1106,14 +1104,14 @@ static bool public_enumerate(public_enumerator_t *this,
*/ */
static void public_destroy(public_enumerator_t *this) static void public_destroy(public_enumerator_t *this)
{ {
DESTROY_IF(this->current);
this->inner->destroy(this->inner);
if (this->wrapper) if (this->wrapper)
{ {
this->this->sets->remove(this->this->sets, this->wrapper, NULL); this->this->sets->remove(this->this->sets, this->wrapper, NULL);
this->this->mutex->unlock(this->this->mutex);
this->wrapper->destroy(this->wrapper); this->wrapper->destroy(this->wrapper);
} }
DESTROY_IF(this->current); this->this->mutex->unlock(this->this->mutex);
this->inner->destroy(this->inner);
free(this); free(this);
} }
@@ -1135,9 +1133,7 @@ static enumerator_t* create_public_enumerator(private_credential_manager_t *this
if (auth) if (auth)
{ {
enumerator->wrapper = auth_info_wrapper_create(auth); enumerator->wrapper = auth_info_wrapper_create(auth);
this->sets->remove(this->sets, this->cache, NULL); this->sets->insert_last(this->sets, enumerator->wrapper);
this->sets->insert_first(this->sets, enumerator->wrapper);
this->sets->insert_first(this->sets, this->cache);
} }
return &enumerator->public; return &enumerator->public;
} }