CVE-2022-37966 s4:kdc: announce PA-SUPPORTED-ETYPES like windows.
authorStefan Metzmacher <metze@samba.org>
Thu, 24 Mar 2022 14:44:40 +0000 (15:44 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2022 13:07:30 +0000 (13:07 +0000)
commitfde745ec3491a4fd7b23e053a67093a2ccaf0905
treecfb2e001e4f68bacd88cbd4fe74eec9e47a9f759
parent1dfa91682efd3b12d7d6af75287efb12ebd9e526
CVE-2022-37966 s4:kdc: announce PA-SUPPORTED-ETYPES like windows.

We need to take the value from the msDS-SupportedEncryptionTypes
attribute and only take the default if there's no value or
if the value is 0.

For krbtgt and DC accounts we need to force support for
ARCFOUR-HMAC-MD5 and AES encryption types and add the related bits
in addtition. (Note for krbtgt msDS-SupportedEncryptionTypes is
completely ignored the hardcoded value is the default, so there's
no AES256-SK for krbtgt).

For UF_USE_DES_KEY_ONLY on the account we reset
the value to 0, these accounts are in fact disabled completely,
as they always result in KRB5KDC_ERR_ETYPE_NOSUPP.

Then we try to get all encryption keys marked in
supported_enctypes, and the available_enctypes
is a reduced set depending on what keys are
actually stored in the database.

We select the supported session key enctypes by the available
keys and in addition based on AES256-SK as well as the
"kdc force enable rc4 weak session keys" option.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13135
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>
selftest/knownfail.d/kdc-enctypes [deleted file]
selftest/knownfail_mit_kdc
source4/kdc/db-glue.c
source4/kdc/sdb.c
source4/kdc/sdb.h