(hx509_ca_tbs_add_san_jid): Allow adding id-pkix-on-xmppAddr OtherName.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19861 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-01-12 08:44:18 +00:00
parent cd5e0fba78
commit 68f12e3ffb

View File

@@ -282,6 +282,37 @@ out:
return ret;
}
int
hx509_ca_tbs_add_san_jid(hx509_context context,
hx509_ca_tbs tbs,
const char *jid)
{
const PKIXXmppAddr ujid = (const PKIXXmppAddr)jid;
heim_octet_string os;
size_t size;
int ret;
os.length = 0;
os.data = NULL;
ASN1_MALLOC_ENCODE(PKIXXmppAddr, os.data, os.length, &ujid, &size, ret);
if (ret) {
hx509_set_error_string(context, 0, ret, "Out of memory");
goto out;
}
if (size != os.length)
_hx509_abort("internal ASN.1 encoder error");
ret = hx509_ca_tbs_add_san_otherName(context,
tbs,
oid_id_pkix_on_xmppAddr(),
&os);
free(os.data);
out:
return ret;
}
int
hx509_ca_tbs_add_san_hostname(hx509_context context,
hx509_ca_tbs tbs,