_krb5_principal2principalname(&rep.ticket.sname,
r->server_princ);
/* java 1.6 expects the name to be the same type, lets allow that
- * uncomplicated name-types. */
+ * uncomplicated name-types, when f.canonicalize is not set (to
+ * match Windows Server 1709). */
#define CNT(sp,t) (((sp)->sname->name_type) == KRB5_NT_##t)
- if (CNT(b, UNKNOWN) || CNT(b, PRINCIPAL) || CNT(b, SRV_INST) || CNT(b, SRV_HST) || CNT(b, SRV_XHST))
+ if (!f.canonicalize
+ && (CNT(b, UNKNOWN) || CNT(b, PRINCIPAL) || CNT(b, SRV_INST) || CNT(b, SRV_HST) || CNT(b, SRV_XHST))) {
rep.ticket.sname.name_type = b->sname->name_type;
+ }
#undef CNT
r->et.flags.initial = 1;