handle ID_KEY_ID as a ID_PUBKEY_SHA1 for authentication

This commit is contained in:
Martin Willi
2008-05-14 06:49:31 +00:00
parent c0d1ebde71
commit 0fd4caea66
2 changed files with 11 additions and 4 deletions
+10 -2
View File
@@ -104,14 +104,22 @@ static bool private_filter(id_data_t *data,
private_key_t **in, private_key_t **out)
{
identification_t *candidate;
id_type_t type;
if (data->id == NULL)
{
*out = *in;
return TRUE;
}
candidate = (*in)->get_id(*in, data->id->get_type(data->id));
if (candidate && data->id->equals(data->id, candidate))
type = data->id->get_type(data->id);
if (type == ID_KEY_ID)
{ /* handle ID_KEY_ID as a ID_PUBKEY_SHA1 */
type = ID_PUBKEY_SHA1;
}
candidate = (*in)->get_id(*in, type);
if (candidate &&
chunk_equals(candidate->get_encoding(candidate),
data->id->get_encoding(data->id)))
{
*out = *in;
return TRUE;