summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcli/auth/krb5_wrap.c8
-rw-r--r--source3/configure.in19
-rwxr-xr-x[-rw-r--r--]source3/wscript9
3 files changed, 12 insertions, 24 deletions
diff --git a/libcli/auth/krb5_wrap.c b/libcli/auth/krb5_wrap.c
index 2f877e7f0a..55a224612d 100644
--- a/libcli/auth/krb5_wrap.c
+++ b/libcli/auth/krb5_wrap.c
@@ -27,7 +27,8 @@
#include "libcli/auth/krb5_wrap.h"
#include "librpc/gen_ndr/krb5pac.h"
-#if defined(HAVE_KRB5_PRINCIPAL2SALT) && defined(HAVE_KRB5_USE_ENCTYPE) && defined(HAVE_KRB5_ENCRYPT_BLOCK)
+#if defined(HAVE_KRB5_PRINCIPAL2SALT) && defined(HAVE_KRB5_C_STRING_TO_KEY)
+/* MIT */
int create_kerberos_key_from_string_direct(krb5_context context,
krb5_principal host_princ,
krb5_data *password,
@@ -36,20 +37,19 @@ int create_kerberos_key_from_string_direct(krb5_context context,
{
int ret = 0;
krb5_data salt;
- krb5_encrypt_block eblock;
ret = krb5_principal2salt(context, host_princ, &salt);
if (ret) {
DEBUG(1,("krb5_principal2salt failed (%s)\n", error_message(ret)));
return ret;
}
- krb5_use_enctype(context, &eblock, enctype);
- ret = krb5_string_to_key(context, &eblock, key, password, &salt);
+ ret = krb5_c_string_to_key(context, enctype, password, &salt, key);
SAFE_FREE(salt.data);
return ret;
}
#elif defined(HAVE_KRB5_GET_PW_SALT) && defined(HAVE_KRB5_STRING_TO_KEY_SALT)
+/* Heimdal */
int create_kerberos_key_from_string_direct(krb5_context context,
krb5_principal host_princ,
krb5_data *password,
diff --git a/source3/configure.in b/source3/configure.in
index 287d20ae7a..45b5474ff7 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -3584,8 +3584,7 @@ if test x"$with_ads_support" != x"no"; then
AC_CHECK_FUNC_EXT(krb5_set_default_tgs_enctypes, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_set_default_tgs_ktypes, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_principal2salt, $KRB5_LIBS)
- AC_CHECK_FUNC_EXT(krb5_use_enctype, $KRB5_LIBS)
- AC_CHECK_FUNC_EXT(krb5_string_to_key, $KRB5_LIBS)
+ AC_CHECK_FUNC_EXT(krb5_c_string_to_key, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_get_pw_salt, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS)
AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
@@ -3723,18 +3722,6 @@ if test x"$with_ads_support" != x"no"; then
[Whether the type krb5_crypto exists])
fi
- AC_CACHE_CHECK([for krb5_encrypt_block type],
- samba_cv_HAVE_KRB5_ENCRYPT_BLOCK,[
- AC_TRY_COMPILE([#include <krb5.h>],
- [krb5_encrypt_block block;],
- samba_cv_HAVE_KRB5_ENCRYPT_BLOCK=yes,
- samba_cv_HAVE_KRB5_ENCRYPT_BLOCK=no)])
-
- if test x"$samba_cv_HAVE_KRB5_ENCRYPT_BLOCK" = x"yes"; then
- AC_DEFINE(HAVE_KRB5_ENCRYPT_BLOCK,1,
- [Whether the type krb5_encrypt_block exists])
- fi
-
AC_CACHE_CHECK([for addrtype in krb5_address],
samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS,[
AC_TRY_COMPILE([#include <krb5.h>],
@@ -4111,9 +4098,9 @@ if test x"$with_ads_support" != x"no"; then
use_ads=no
fi
- if test x"$ac_cv_func_ext_krb5_string_to_key" != x"yes"
+ if test x"$ac_cv_func_ext_krb5_c_string_to_key" != x"yes"
then
- AC_MSG_WARN(krb5_string_to_key not found in -lkrb5)
+ AC_MSG_WARN(krb5_c_string_to_key not found in -lkrb5)
use_ads=no
fi
diff --git a/source3/wscript b/source3/wscript
index 2da00ecabe..e0a4ea742d 100644..100755
--- a/source3/wscript
+++ b/source3/wscript
@@ -579,8 +579,8 @@ msg.msg_acctrightslen = sizeof(fd);
conf.CHECK_FUNCS_IN('krb5_mk_req_extended krb5_kt_compare', 'krb5')
conf.CHECK_FUNCS('''
krb5_set_default_in_tkt_etypes krb5_set_default_tgs_enctypes
-krb5_set_default_tgs_ktypes krb5_principal2salt krb5_use_enctype
-krb5_string_to_key krb5_get_pw_salt krb5_string_to_key_salt krb5_auth_con_setkey
+krb5_set_default_tgs_ktypes krb5_principal2salt
+krb5_c_string_to_key krb5_get_pw_salt krb5_string_to_key_salt krb5_auth_con_setkey
krb5_auth_con_setuseruserkey krb5_get_permitted_enctypes
krb5_get_default_in_tkt_etypes krb5_free_data_contents
krb5_principal_get_comp_string krb5_free_unparsed_name
@@ -754,8 +754,9 @@ return krb5_kt_resolve(context, "WRFILE:api", &keytab);
if not conf.CONFIG_SET('HAVE_KRB5_PRINCIPAL_COMPARE_ANY_REALM'):
Logs.warn("krb5_principal_compare_any_realm not found in -lkrb5")
use_ads=False
- if not conf.CONFIG_SET('HAVE_KRB5_STRING_TO_KEY'):
- Logs.warn("krb5_string_to_key not found in -lkrb5")
+ if not conf.CONFIG_SET('HAVE_KRB5_C_STRING_TO_KEY') and \
+ not conf.CONFIG_SET('HAVE_KRB5_STRING_TO_KEY_SALT'):
+ Logs.warn("krb5_c_string_to_key not found in -lkrb5")
use_ads=False
if not conf.CONFIG_SET('HAVE_KRB5_PRINCIPAL2SALT') and \
not conf.CONFIG_SET('HAVE_KRB5_GET_PW_SALT'):