heimdal: Cope with newer Heimdal versions accepting a keyset argument to
authorJelmer Vernooij <jelmer@samba.org>
Mon, 7 May 2012 14:43:17 +0000 (16:43 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 7 May 2012 16:33:10 +0000 (18:33 +0200)
hdb_enctype2key.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon May  7 18:33:10 CEST 2012 on sn-devel-104

source4/heimdal_build/wscript_configure
source4/kdc/pac-glue.c

index a350a8bae99ca3e56c5f100f9352f7c7eb4c7871..619944d1d4fa9b55b8886c7a8ae2e6a41bb8b3be 100755 (executable)
@@ -213,15 +213,33 @@ check_system_heimdal_lib("gssapi", "gss_oid_to_name", "gssapi.h",
     onlyif="hcrypto asn1 roken krb5 com_err wind")
 check_system_heimdal_lib("heimntlm", "heim_ntlm_ntlmv2_key", "heimntlm.h",
     onlyif="roken hcrypto krb5")
-check_system_heimdal_lib("hdb", "hdb_db_dir", "krb5.h hdb.h",
-    onlyif="roken krb5 hcrypto com_err wind")
+if check_system_heimdal_lib("hdb", "hdb_db_dir", "krb5.h hdb.h",
+    onlyif="roken krb5 hcrypto com_err wind"):
+    CCDEFINES = list(conf.env.CCDEFINES)
+    conf.undefine("HAVE_CONFIG_H")
+    while "HAVE_CONFIG_H=1" in conf.env.CCDEFINES:
+        conf.env.CCDEFINES.remove("HAVE_CONFIG_H=1")
+    try:
+        conf.CHECK_CODE('''
+            #include <hdb.h>
+            int main(void) { hdb_enctype2key(NULL, NULL, NULL, 0, NULL); }
+            ''',
+            define='HDB_ENCTYPE2KEY_TAKES_KEYSET',
+            addmain=False,
+            lib='hdb',
+            msg='Checking whether hdb_enctype2key takes a keyset argument',
+            local_include=False)
+    finally:
+        conf.env.CCDEFINES = CCDEFINES
+        conf.define("HAVE_CONFIG_H", "1")
+
 check_system_heimdal_lib("kdc", "kdc_log", "kdc.h",
     onlyif="roken krb5 hdb asn1 heimntlm hcrypto com_err wind heimbase")
 
 
 # With the proper checks in place we should be able to build against the system libtommath.
-# conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h')
-# conf.define('USING_SYSTEM_TOMMATH', 1)
+#if conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h'):
+#    conf.define('USING_SYSTEM_TOMMATH', 1)
 
 check_system_heimdal_binary("compile_et")
 check_system_heimdal_binary("asn1_compile")
index d654dc32cae63493be35ecfab53e9dabe072f528..cca74d850a9b15cdd8e2ed56c253aac716f4c9f1 100644 (file)
@@ -482,7 +482,11 @@ int kdc_check_pac(krb5_context context,
                }
        }
 
+#if HDB_ENCTYPE2KEY_TAKES_KEYSET
+       ret = hdb_enctype2key(context, &ent->entry, NULL, etype, &key);
+#else
        ret = hdb_enctype2key(context, &ent->entry, etype, &key);
+#endif
 
        if (ret != 0) {
                return ret;