tests: ensure AD-SUPPORT subpolicy is active

Use AD-SUPPORT subpolicy when testing trust to Active Directory in FIPS
mode. This is required in FIPS mode due to AD not supporting Kerberos
AES-bases encryption types using FIPS-compliant PBKDF2 and KDF, as
defined in RFC 8009.

Fixes: https://pagure.io/freeipa/issue/9119

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Julien Rische <jrische@redhat.com>
Reviewed-By: Francisco Trivino <ftrivino@redhat.com>
This commit is contained in:
Alexander Bokovoy
2022-02-28 11:10:49 +02:00
committed by Florence Blanc-Renaud
parent d38dd2680f
commit 2eee5931d7
2 changed files with 9 additions and 0 deletions

View File

@@ -68,3 +68,9 @@ def disable_userspace_fips(host):
# sanity check
assert not is_fips_enabled(host)
host.run_command(["openssl", "md5", "/dev/null"])
def enable_crypto_subpolicy(host, subpolicy):
result = host.run_command(["update-crypto-policies", "--show"])
policy = result.stdin_text.strip() + ":" + subpolicy
host.run_command(["update-crypto-policies", "--set", policy])

View File

@@ -66,6 +66,7 @@ from .env_config import env_to_script
from .host import Host
from .firewall import Firewall
from .resolver import ResolvedResolver
from .fips import is_fips_enabled, enable_crypto_subpolicy
logger = logging.getLogger(__name__)
@@ -362,6 +363,8 @@ def install_master(host, setup_dns=True, setup_kra=False, setup_adtrust=False,
if setup_adtrust:
args.append('--setup-adtrust')
fw_services.append("freeipa-trust")
if is_fips_enabled(host):
enable_crypto_subpolicy(host, "AD-SUPPORT")
if external_ca:
args.append('--external-ca')