From 3b7a86024b53fd0ac1a98e92bd93a170a1979aec Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 4 Nov 2010 19:29:01 +0100 Subject: Use internal implementation of internal Kerberos functions Don't use KRB5_PRIVATE. The patch implements and uses the following krb5 functions that are otherwise private in recent MIT Kerberos releases: * krb5_principal2salt_norealm * krb5_free_ktypes Signed-off-by: Simo Sorce --- daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am | 4 ++++ daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h | 1 - daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'daemons') diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am index 6f6092d20..41d9f2378 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/Makefile.am @@ -1,11 +1,14 @@ NULL = PLUGIN_COMMON_DIR=../common +KRB5_UTIL_DIR= ../../../util +KRB5_UTIL_SRCS=$(KRB5_UTIL_DIR)/ipa_krb5.c INCLUDES = \ -I. \ -I$(srcdir) \ -I$(PLUGIN_COMMON_DIR) \ + -I$(KRB5_UTIL_DIR) \ -DPREFIX=\""$(prefix)"\" \ -DBINDIR=\""$(bindir)"\" \ -DLIBDIR=\""$(libdir)"\" \ @@ -28,6 +31,7 @@ libipa_pwd_extop_la_SOURCES = \ ipapwd_encoding.c \ ipapwd_prepost.c \ ipa_pwd_extop.c \ + $(KRB5_UTIL_SRCS) \ $(NULL) libipa_pwd_extop_la_LDFLAGS = -avoid-version diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h index 523934ccd..bc521071e 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd.h @@ -52,7 +52,6 @@ #include #include #include -#define KRB5_PRIVATE 1 #include #include #include diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c index 451350163..bba636773 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_encoding.c @@ -54,6 +54,7 @@ #include "ipapwd.h" #include "util.h" +#include "ipa_krb5.h" /* krbTicketFlags */ #define KTF_DISALLOW_POSTDATED 0x00000001 @@ -341,7 +342,7 @@ static Slapi_Value **encrypt_encode_key(struct ipapwd_krbcfg *krbcfg, case KRB5_KDB_SALTTYPE_NOREALM: - krberr = krb5_principal2salt_norealm(krbctx, princ, &salt); + krberr = ipa_krb5_principal2salt_norealm(krbctx, princ, &salt); if (krberr) { LOG_FATAL("krb5_principal2salt failed [%s]\n", krb5_get_error_message(krbctx, krberr)); -- cgit