From 19138c5ba3dd8fafcab766427cf025848d5d6016 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Thu, 23 Nov 2017 18:06:56 +0100 Subject: [PATCH] Fix ca less IPA install on fips mode When ipa-server-install is run in fips mode and ca-less, the installer fails when the keys are provided with --{http|dirsrv|pkinit}-cert-file in a separate key file. The installer transforms the key into PKCS#8 format using openssl pkcs8 -topk8 but this command fails on a fips-enabled server, unless the options -v2 aes256 -v2prf hmacWithSHA256 are also provided. Fixes: https://pagure.io/freeipa/issue/7280 Reviewed-By: Christian Heimes --- ipapython/certdb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipapython/certdb.py b/ipapython/certdb.py index de2a42117..7e5770f9b 100644 --- a/ipapython/certdb.py +++ b/ipapython/certdb.py @@ -605,9 +605,13 @@ class NSSDatabase(object): "Can't load private key from both %s and %s" % (key_file, filename)) + # the args -v2 aes256 -v2prf hmacWithSHA256 are needed + # on OpenSSL 1.0.2 (fips mode). As soon as FreeIPA + # requires OpenSSL 1.1.0 we'll be able to drop them args = [ paths.OPENSSL, 'pkcs8', '-topk8', + '-v2', 'aes256', '-v2prf', 'hmacWithSHA256', '-passout', 'file:' + self.pwd_file, ] if ((label != b'PRIVATE KEY' and key_password) or