CVE-2022-37966 s3:libads: remove unused ifdef HAVE_ENCTYPE_AES*
authorStefan Metzmacher <metze@samba.org>
Wed, 23 Nov 2022 14:18:02 +0000 (15:18 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2022 23:48:49 +0000 (00:48 +0100)
aes encryption types are always supported.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2bd27955ce1000c13b468934eed8b0fdeb66e3bf)

source3/libads/kerberos.c
source3/libads/kerberos_keytab.c

index 3fd86e87064ea871200f8e4c3ff8f37cbddee644..a4a5e040c1752b3d8cf47e970622eabc7c2828b3 100644 (file)
@@ -622,20 +622,16 @@ static char *get_enctypes(TALLOC_CTX *mem_ctx)
 
        if (lp_kerberos_encryption_types() == KERBEROS_ETYPES_ALL ||
            lp_kerberos_encryption_types() == KERBEROS_ETYPES_STRONG) {
-#ifdef HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96
                aes_enctypes = talloc_asprintf_append(
                    aes_enctypes, "%s", "aes256-cts-hmac-sha1-96 ");
                if (aes_enctypes == NULL) {
                        goto done;
                }
-#endif
-#ifdef HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96
                aes_enctypes = talloc_asprintf_append(
                    aes_enctypes, "%s", "aes128-cts-hmac-sha1-96");
                if (aes_enctypes == NULL) {
                        goto done;
                }
-#endif
        }
 
        if (lp_weak_crypto() == SAMBA_WEAK_CRYPTO_ALLOWED &&
index b7e1846bd9ff662c87bdec19094ecfe92d087465..ae459bc30ca3b2be3442f03d3f8c5c12a9c65176 100644 (file)
@@ -238,12 +238,8 @@ static int add_kt_entry_etypes(krb5_context context, TALLOC_CTX *tmpctx,
        char *princ_s = NULL;
        char *short_princ_s = NULL;
        krb5_enctype enctypes[4] = {
-#ifdef HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96
                ENCTYPE_AES256_CTS_HMAC_SHA1_96,
-#endif
-#ifdef HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96
                ENCTYPE_AES128_CTS_HMAC_SHA1_96,
-#endif
                ENCTYPE_ARCFOUR_HMAC,
                0
        };