Update krb-types.pac

KerberosString formatting for principal name to be compliant with RFC 4120 section 5.2.2, which states that there can be a few components (and in practice we have seen 3, more than the 1 or 2 that is typical)
This commit is contained in:
jamesecorrenti 2016-11-22 16:41:56 -05:00 committed by GitHub
parent 7b44974a58
commit 4b4ccabd70

View file

@ -19,6 +19,8 @@ Val* GetStringFromPrincipalName(const KRB_Principal_Name* pname)
return bytestring_to_val(pname->data()[0][0]->encoding()->content());
if ( pname->data()->size() == 2 )
return new StringVal(fmt("%s/%s", (char *) pname->data()[0][0]->encoding()->content().begin(), (char *)pname->data()[0][1]->encoding()->content().begin()));
if ( pname->data()->size() == 3 )  # if the name-string has a third value, this will just append it, else this will return unkown as the principal name
return new StringVal(fmt("%s/%s/%s", (char *) pname->data()[0][0]->encoding()->content().begin(), (char *)pname->data()[0][1]->encoding()->content().begin(), (char *)pname->data()[0][2]->encoding()->content().begin()));
return new StringVal("unknown");
}