summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/asn1_glue.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-09-22 18:39:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:19:14 -0500
commit83558e822b9b1ea64ae89b77b2d815d19211d996 (patch)
tree2d627bc8675ab721d55b822bbdd7934ec00f6b5c /source4/heimdal/lib/krb5/asn1_glue.c
parentdaf51dfe26378e80d14c0b608c70a41b7e017e69 (diff)
downloadsamba-83558e822b9b1ea64ae89b77b2d815d19211d996.tar.gz
samba-83558e822b9b1ea64ae89b77b2d815d19211d996.tar.bz2
samba-83558e822b9b1ea64ae89b77b2d815d19211d996.zip
r18826: Allow 'enterprise' principal names to log in.
These principals do not need to be in the same realm as the rest of the ticket, the full principal name is in the first componet of the ASN.1. Samba4's backend will handle getting this to the 'right' place. Andrew Bartlett (This used to be commit 90b01b8af21609e2e5c8b6bd8cab8bd393844acf)
Diffstat (limited to 'source4/heimdal/lib/krb5/asn1_glue.c')
-rw-r--r--source4/heimdal/lib/krb5/asn1_glue.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source4/heimdal/lib/krb5/asn1_glue.c b/source4/heimdal/lib/krb5/asn1_glue.c
index 01b5d3ee44..8f7b886e80 100644
--- a/source4/heimdal/lib/krb5/asn1_glue.c
+++ b/source4/heimdal/lib/krb5/asn1_glue.c
@@ -47,13 +47,23 @@ _krb5_principal2principalname (PrincipalName *p,
}
krb5_error_code KRB5_LIB_FUNCTION
-_krb5_principalname2krb5_principal (krb5_principal *principal,
+_krb5_principalname2krb5_principal (krb5_context context,
+ krb5_principal *principal,
const PrincipalName from,
const Realm realm)
{
- krb5_principal p = malloc(sizeof(*p));
- copy_PrincipalName(&from, &p->name);
- p->realm = strdup(realm);
- *principal = p;
+ if (from.name_type == KRB5_NT_ENTERPRISE_PRINCIPAL) {
+ if (from.name_string.len != 1) {
+ return KRB5_PARSE_MALFORMED;
+ }
+ return krb5_parse_name(context,
+ from.name_string.val[0],
+ principal);
+ } else {
+ krb5_principal p = malloc(sizeof(*p));
+ copy_PrincipalName(&from, &p->name);
+ p->realm = strdup(realm);
+ *principal = p;
+ }
return 0;
}