]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r3342: More MIT/Heimdal fixes to allow an enctype to be explicitly set in a krb5_creds
authorJeremy Allison <jra@samba.org>
Thu, 28 Oct 2004 23:50:14 +0000 (23:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:05 +0000 (10:53 -0500)
struct.
Jeremy.

source/configure.in
source/libsmb/clikrb5.c

index 83d12d5c904accb377191f0d0f0854ce98f3118f..da60e284eca8ce64be02a89861fb51652fd85807 100644 (file)
@@ -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>],
index f7f84f1e2976aaa258ad782722f360c3e67efa7f..291aa13de018f63ac5752e837a8921b8210557a6 100644 (file)
 }
 #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)