summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-22 14:58:01 +0200
committerGünther Deschner <gd@samba.org>2008-08-29 11:01:34 +0200
commitbff20e14c38d7139033127182b76aa24e471b581 (patch)
treef5b2568566befdbcc06dad83650837abf430ab6a /source3/libsmb
parent87ea8f3fae44b5442f1e5303bf1d5326f1bfd5ae (diff)
downloadsamba-bff20e14c38d7139033127182b76aa24e471b581.tar.gz
samba-bff20e14c38d7139033127182b76aa24e471b581.tar.bz2
samba-bff20e14c38d7139033127182b76aa24e471b581.zip
kerberos: use KRB5_KT_KEY macro where appropriate.
Guenther (This used to be commit a042dffd7121bda3dbc9509f69fcfae06ed4cc22)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clikrb5.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index b6fb7cf050..bedd7d7aee 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -1045,6 +1045,7 @@ get_key_from_keytab(krb5_context context,
krb5_error_code ret;
krb5_keytab keytab;
char *name = NULL;
+ krb5_keyblock *keyp;
/* We have to open a new keytab handle here, as MIT does
an implicit open/getnext/close on krb5_kt_get_entry. We
@@ -1077,14 +1078,9 @@ get_key_from_keytab(krb5_context context,
goto out;
}
-#ifdef HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK /* Heimdal */
- ret = krb5_copy_keyblock(context, &entry.keyblock, out_key);
-#elif defined(HAVE_KRB5_KEYTAB_ENTRY_KEY) /* MIT */
- ret = krb5_copy_keyblock(context, &entry.key, out_key);
-#else
-#error UNKNOWN_KRB5_KEYTAB_ENTRY_FORMAT
-#endif
+ keyp = KRB5_KT_KEY(&entry);
+ ret = krb5_copy_keyblock(context, keyp, out_key);
if (ret) {
DEBUG(0,("get_key_from_keytab: failed to copy key: %s\n", error_message(ret)));
goto out;
@@ -1572,15 +1568,9 @@ done:
#endif /* HAVE_KRB5_GET_INIT_CREDS_OPT_FREE */
}
- krb5_enctype smb_get_enctype_from_kt_entry(const krb5_keytab_entry *kt_entry)
+ krb5_enctype smb_get_enctype_from_kt_entry(krb5_keytab_entry *kt_entry)
{
-#ifdef HAVE_KRB5_KEYTAB_ENTRY_KEY /* MIT */
- return kt_entry->key.enctype;
-#elif defined(HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK) /* Heimdal */
- return kt_entry->keyblock.keytype;
-#else
-#error UNKNOWN_KRB5_KEYTAB_ENTRY_KEYBLOCK_FORMAT
-#endif
+ return KRB5_KEY_TYPE(KRB5_KT_KEY(kt_entry));
}