summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-10-28 23:50:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:05 -0500
commitc9b80490128e09442a01dd8ec6f4b453769e82c1 (patch)
treef47119cc8904a7268dada06672d9b97f0bd9ad76
parent682b746ab6ff10bf9970e808f0032066e5f3b783 (diff)
downloadsamba-c9b80490128e09442a01dd8ec6f4b453769e82c1.tar.gz
samba-c9b80490128e09442a01dd8ec6f4b453769e82c1.tar.xz
samba-c9b80490128e09442a01dd8ec6f4b453769e82c1.zip
r3342: More MIT/Heimdal fixes to allow an enctype to be explicitly set in a krb5_creds
struct. Jeremy.
-rw-r--r--source/configure.in24
-rw-r--r--source/libsmb/clikrb5.c11
2 files changed, 35 insertions, 0 deletions
diff --git a/source/configure.in b/source/configure.in
index 83d12d5c904..da60e284eca 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -2822,6 +2822,30 @@ if test x"$with_ads_support" != x"no"; then
[Whether the krb5_ticket struct has a enc_part2 property])
fi
+ AC_CACHE_CHECK([for keyblock in krb5_creds],
+ samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS,[
+ AC_TRY_COMPILE([#include <krb5.h>],
+ [krb5_creds creds; krb5_keyblock kb; creds.keyblock = kb;],
+ samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=yes,
+ samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=no)])
+
+ if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" = x"yes"; then
+ AC_DEFINE(HAVE_KRB5_KEYBLOCK_IN_CREDS,1,
+ [Whether the krb5_creds struct has a keyblock property])
+ fi
+
+ AC_CACHE_CHECK([for session in krb5_creds],
+ samba_cv_HAVE_KRB5_SESSION_IN_CREDS,[
+ AC_TRY_COMPILE([#include <krb5.h>],
+ [krb5_creds creds; krb5_keyblock kb; creds.session = kb;],
+ samba_cv_HAVE_KRB5_SESSION_IN_CREDS=yes,
+ samba_cv_HAVE_KRB5_SESSION_IN_CREDS=no)])
+
+ if test x"$samba_cv_HAVE_KRB5_SESSION_IN_CREDS" = x"yes"; then
+ AC_DEFINE(HAVE_KRB5_SESSION_IN_CREDS,1,
+ [Whether the krb5_creds struct has a session property])
+ fi
+
AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE,[
AC_TRY_COMPILE([#include <krb5.h>],
diff --git a/source/libsmb/clikrb5.c b/source/libsmb/clikrb5.c
index f7f84f1e297..291aa13de01 100644
--- a/source/libsmb/clikrb5.c
+++ b/source/libsmb/clikrb5.c
@@ -251,6 +251,17 @@
}
#endif
+void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype)
+{
+#if defined(HAVE_KRB5_KEYBLOCK_IN_CREDS)
+ KRB5_KEY_TYPE((&pcreds->keyblock)) = enctype;
+#elif defined(HAVE_KRB5_SESSION_IN_CREDS)
+ KRB5_KEY_TYPE((&pcreds->session)) = enctype;
+#else
+#error UNKNOWN_KEYBLOCK_MEMBER_IN_KRB5_CREDS_STRUCT
+#endif
+}
+
static BOOL ads_cleanup_expired_creds(krb5_context context,
krb5_ccache ccache,
krb5_creds *credsp)