Select subjectAltName address family using address length in x509 plugin

This commit is contained in:
Martin Willi
2010-06-24 12:01:18 +02:00
parent 9eb7f46b3d
commit 7a74295e42
+11 -1
View File
@@ -366,7 +366,17 @@ static identification_t *parse_generalName(chunk_t blob, int level0)
id_type = ID_DER_ASN1_DN;
break;
case GN_OBJ_IP_ADDRESS:
id_type = ID_IPV4_ADDR;
switch (object.len)
{
case 4:
id_type = ID_IPV4_ADDR;
break;
case 16:
id_type = ID_IPV6_ADDR;
break;
default:
break;
}
break;
case GN_OBJ_OTHER_NAME:
if (!parse_otherName(object, parser->get_level(parser)+1))