From 3f12b14e68f8da767f95d975730d78a60cbaf21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 15 Jul 2003 17:53:48 +0000 Subject: [PATCH] (krb5_compare_creds): if client is specified in the mcreds, check that too git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12441 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/creds.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/krb5/creds.c b/lib/krb5/creds.c index de001f41b..2eb0ba33a 100644 --- a/lib/krb5/creds.c +++ b/lib/krb5/creds.c @@ -135,13 +135,20 @@ krb5_compare_creds(krb5_context context, krb5_flags whichfields, const krb5_creds *mcreds, const krb5_creds *creds) { krb5_boolean match; + krb5_error_code (*matchfun)(krb5_context, + krb5_const_principal, + krb5_const_principal); if(whichfields & KRB5_TC_DONT_MATCH_REALM) - match = krb5_principal_compare_any_realm(context, - mcreds->server, - creds->server); + matchfun = krb5_principal_compare_any_realm; else - match = krb5_principal_compare(context, mcreds->server, creds->server); + matchfun = krb5_principal_compare; + + match = (*matchfun)(context, mcreds->server, creds->server); + + if (match && mcreds->client) + match = (*matchfun)(context, mcreds->client, creds->client); + if(match && (whichfields & KRB5_TC_MATCH_KEYTYPE) && !krb5_enctypes_compatible_keys (context, mcreds->session.keytype,