(hx509_ca_tbs_add_eku): filter out dups

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19887 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-01-13 12:29:06 +00:00
parent 419060e44f
commit ab5ec24f71

View File

@@ -166,6 +166,13 @@ hx509_ca_tbs_add_eku(hx509_context contex,
{
void *ptr;
int ret;
unsigned i;
/* search for duplicates */
for (i = 0; i < tbs->eku.len; i++) {
if (der_heim_oid_cmp(oid, &tbs->eku.val[i]) == 0)
return 0;
}
ptr = realloc(tbs->eku.val, sizeof(tbs->eku.val[0]) * (tbs->eku.len + 1));
if (ptr == NULL)