Avoid enumerating certificates with non-matching key type
If the key type was specified but the ID was NULL or matched a subject, it was possible that a certificate was returned that didn't actually match the requested key type. Closes strongswan/strongswan#141.
This commit is contained in:
@@ -208,6 +208,11 @@ CALLBACK(certs_filter, bool,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
public->destroy(public);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
public->destroy(public);
|
public->destroy(public);
|
||||||
}
|
}
|
||||||
else if (data->key != KEY_ANY)
|
else if (data->key != KEY_ANY)
|
||||||
|
|||||||
@@ -108,6 +108,11 @@ CALLBACK(certs_filter, bool,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
public->destroy(public);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
public->destroy(public);
|
public->destroy(public);
|
||||||
}
|
}
|
||||||
else if (data->key != KEY_ANY)
|
else if (data->key != KEY_ANY)
|
||||||
|
|||||||
Reference in New Issue
Block a user