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 --- ipa-client/Makefile.am | 5 +++++ ipa-client/ipa-getkeytab.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'ipa-client') diff --git a/ipa-client/Makefile.am b/ipa-client/Makefile.am index 655a6866..ebb9a839 100644 --- a/ipa-client/Makefile.am +++ b/ipa-client/Makefile.am @@ -12,9 +12,13 @@ if HAVE_GCC endif export AM_CFLAGS +KRB5_UTIL_DIR=../util +KRB5_UTIL_SRCS=$(KRB5_UTIL_DIR)/ipa_krb5.c + INCLUDES = \ -I. \ -I$(srcdir) \ + -I$(KRB5_UTIL_DIR) \ -DPREFIX=\""$(prefix)"\" \ -DBINDIR=\""$(bindir)"\" \ -DLIBDIR=\""$(libdir)"\" \ @@ -38,6 +42,7 @@ sbin_PROGRAMS = \ ipa_getkeytab_SOURCES = \ ipa-getkeytab.c \ + $(KRB5_UTIL_SRCS) \ $(NULL) ipa_getkeytab_LDADD = \ diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c index a54c57c7..85886526 100644 --- a/ipa-client/ipa-getkeytab.c +++ b/ipa-client/ipa-getkeytab.c @@ -27,10 +27,10 @@ #include #include #include +#include #include #include #include -#define KRB5_PRIVATE 1 #include #ifdef WITH_MOZLDAP #include @@ -44,6 +44,8 @@ #include #define _(STRING) gettext(STRING) +#include "ipa_krb5.h" + /* Salt types */ #define NO_SALT -1 #define KRB5_KDB_SALTTYPE_NORMAL 0 @@ -152,7 +154,7 @@ static int prep_ksdata(krb5_context krbctx, const char *str, ksdata[i].salttype = KRB5_KDB_SALTTYPE_NORMAL; } - krb5_free_ktypes(krbctx, ktypes); + ipa_krb5_free_ktypes(krbctx, ktypes); nkeys = i; @@ -322,7 +324,7 @@ static int create_keys(krb5_context krbctx, break; case KRB5_KDB_SALTTYPE_NOREALM: - krberr = krb5_principal2salt_norealm(krbctx, princ, &ksdata[i].salt); + krberr = ipa_krb5_principal2salt_norealm(krbctx, princ, &ksdata[i].salt); if (krberr) { fprintf(stderr, _("Failed to create key!\n")); return 0; @@ -848,7 +850,7 @@ int main(int argc, char *argv[]) } fprintf(stdout, "%s\n", enc); } - krb5_free_ktypes(krbctx, ktypes); + ipa_krb5_free_ktypes(krbctx, ktypes); exit (0); } -- cgit