switch (oid)
{
case OID_XMPP_ADDR:
- if (!asn1_parse_simple_object(&object, ASN1_UTF8STRING,
+ if (asn1_parse_simple_object(&object, ASN1_UTF8STRING,
parser->get_level(parser)+1, "xmppAddr"))
+ { /* we handle xmppAddr as RFC822 addr */
+ *blob = object;
+ *type = ID_RFC822_ADDR;
+ }
+ else
{
goto end;
}
switch (id->get_type(id))
{
+ case ID_DER_ASN1_GN:
+ return chunk_clone(id->get_encoding(id));
case ID_RFC822_ADDR:
context = ASN1_CONTEXT_S_1;
break;
.data.c = chunk_from_chars(0xc0,0xa8,0x01,0x01) }},
{ "email:tester", ID_RFC822_ADDR, { .type = ENC_STRING,
.data.s = "tester" }},
+ {"xmppaddr:bob@strongswan.org", ID_DER_ASN1_GN, { .type = ENC_CHUNK,
+ .data.c = chunk_from_chars(0xa0,0x20,0x06,0x08,0x2b,0x06,0x01,0x05,
+ 0x05,0x07,0x08,0x05,0xa0,0x14,0x0c,0x12,
+ 0x62,0x6f,0x62,0x40,0x73,0x74,0x72,0x6f,
+ 0x6e,0x67,0x73,0x77,0x61,0x6e,0x2e,0x6f,
+ 0x72,0x67) }},
{ "{1}:#c0a80101", ID_IPV4_ADDR, { .type = ENC_CHUNK,
.data.c = chunk_from_chars(0xc0,0xa8,0x01,0x01) }},
{ "{0x02}:tester", ID_FQDN, { .type = ENC_STRING,
{ "dns:", ID_FQDN },
{ "asn1dn:", ID_DER_ASN1_DN },
{ "asn1gn:", ID_DER_ASN1_GN },
+ { "xmppaddr:", ID_DER_ASN1_GN },
{ "keyid:", ID_KEY_ID },
};
private_identification_t *this;
{
this = identification_create(prefixes[i].type);
str += strlen(prefixes[i].str);
+
if (*str == '#')
{
this->encoded = chunk_from_hex(chunk_from_str(str + 1), NULL);
{
this->encoded = chunk_clone(chunk_from_str(str));
}
+
+ if (prefixes[i].type == ID_DER_ASN1_GN &&
+ strcasepfx(prefixes[i].str, "xmppaddr:"))
+ {
+ this->encoded = asn1_wrap(ASN1_CONTEXT_C_0, "mm",
+ asn1_build_known_oid(OID_XMPP_ADDR),
+ asn1_wrap(ASN1_CONTEXT_C_0, "m",
+ asn1_wrap(ASN1_UTF8STRING, "m",
+ this->encoded)));
+ }
+
return this;
}
}