]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix keyblock use for Heimdal in kerberos_ldap_group helper (#627)
authorhuaraz <huaraz@moeller.plus.com>
Wed, 20 May 2020 13:00:00 +0000 (13:00 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 29 May 2020 18:38:59 +0000 (06:38 +1200)
Heimdal uses a different keyblock structure. Symptoms:

    error: 'krb5_creds' ... has no member named 'keyblock'

src/acl/external/kerberos_ldap_group/support_krb5.cc

index 6d50c73166135c9f806cc06ef561413bed30d920..a9a3605580804271c9bff0ebe554caf89e2f59d4 100644 (file)
@@ -467,10 +467,15 @@ krb5_create_cache(char *domain, char *service_principal_name)
                 }
 
                 // overwrite limitation of enctypes
+#if USE_HEIMDAL_KRB5
+                creds->session.keytype = 0;
+                if (creds->session.keyvalue.length > 0)
+                    krb5_free_keyblock_contents(kparam.context, &creds->session);
+#else
                 creds->keyblock.enctype = 0;
                 if (creds->keyblock.contents)
                     krb5_free_keyblock_contents(kparam.context, &creds->keyblock);
-
+#endif
                 code = krb5_get_credentials(kparam.context, 0, kparam.cc[ccindex], creds, &tgt_creds);
                 if (code) {
                     k5_error("Error while getting tgt", code);