append new attribute certs at the end
This commit is contained in:
@@ -1094,6 +1094,7 @@ static void add_attr_certificate(private_local_credential_store_t *this, x509ac_
|
|||||||
{
|
{
|
||||||
iterator_t *iterator;
|
iterator_t *iterator;
|
||||||
x509ac_t *current_cert;
|
x509ac_t *current_cert;
|
||||||
|
bool found = FALSE;
|
||||||
|
|
||||||
pthread_mutex_lock(&(this->acerts_mutex));
|
pthread_mutex_lock(&(this->acerts_mutex));
|
||||||
iterator = this->acerts->create_iterator(this->acerts, TRUE);
|
iterator = this->acerts->create_iterator(this->acerts, TRUE);
|
||||||
@@ -1113,11 +1114,16 @@ static void add_attr_certificate(private_local_credential_store_t *this, x509ac_
|
|||||||
cert->destroy(cert);
|
cert->destroy(cert);
|
||||||
DBG1(DBG_CFG, " this attr cert is not newer - existing attr cert retained");
|
DBG1(DBG_CFG, " this attr cert is not newer - existing attr cert retained");
|
||||||
}
|
}
|
||||||
|
found = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator->destroy(iterator);
|
iterator->destroy(iterator);
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
this->acerts->insert_last(this->acerts, (void *)cert);
|
||||||
|
}
|
||||||
pthread_mutex_unlock(&(this->acerts_mutex));
|
pthread_mutex_unlock(&(this->acerts_mutex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user