1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

krb5samba: Add compat function for krb5_kt_compare

This commit is contained in:
Simo Sorce 2012-04-26 18:22:43 -04:00
parent 548046ff4d
commit 38c7d8e4fd
2 changed files with 39 additions and 0 deletions

View File

@ -227,3 +227,32 @@ krb5_error_code kt_copy_one_principal(krb5_context context,
krb5_kt_close (context, dst_keytab);
return ret;
}
#if !defined(HAVE_KRB5_KT_COMPARE)
krb5_boolean smb_krb5_kt_compare(krb5_context context,
krb5_keytab_entry *entry,
krb5_const_principal principal,
krb5_kvno kvno,
krb5_enctype enctype)
{
if (principal) {
if (!krb5_principal_compare(context,
entry->principal, principal)) {
return false;
}
}
if (kvno) {
if (entry->vno != kvno) {
return false;
}
}
if (enctype) {
if (KRB5_KEY_TYPE(KRB5_KT_KEY(entry)) != enctype) {
return false;
}
}
return true;
}
#endif

View File

@ -267,6 +267,16 @@ krb5_error_code kt_copy_one_principal(krb5_context context,
krb5_kvno kvno,
krb5_enctype *enctypes);
#if defined(HAVE_KRB5_KT_COMPARE)
#define smb_krb5_kt_compare krb5_kt_compare
#else
krb5_boolean smb_krb5_kt_compare(krb5_context context,
krb5_keytab_entry *entry,
krb5_const_principal principal,
krb5_kvno vno,
krb5_enctype enctype);
#endif
#endif /* HAVE_KRB5 */
int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx,