krb5_boolean
krb5int_cc_creds_match_request(krb5_context context, krb5_flags whichfields, krb5_creds *mcreds, krb5_creds *creds)
{
+ /* Only match a user-to-user credential if explicitly asked for, since the
+ * ticket won't work as a regular service ticket. */
+ if (! set(KRB5_TC_MATCH_IS_SKEY) && creds->is_skey)
+ return FALSE;
+
if (((set(KRB5_TC_MATCH_SRV_NAMEONLY) &&
srvname_match(context, mcreds, creds)) ||
standard_fields_match(context, mcreds, creds))
realm.run([kvno, '--u2u', u2u_ccache, 'alice'], expected_msg='kvno = 0')
realm.run([kadminl, 'modprinc', '+allow_svr', 'alice'])
+# Verify that normal lookups ignore the user-to-user ticket.
+realm.run([kvno, 'alice'], expected_msg='kvno = 1')
+out = realm.run([klist])
+if out.count('alice@KRBTEST.COM') != 2:
+ fail('expected two alice tickets after regular kvno')
+
# Try u2u against the client user.
realm.run([kvno, '--u2u', realm.ccache, realm.user_princ])
realm.run([klist])
+
+success('user-to-user tests')