Blame SOURCES/pki-core-10.5.1-batch-2.0.patch

2413b1
From c4f6b7c6d4a0d8130c46cd1f820f8980b7f314e2 Mon Sep 17 00:00:00 2001
2413b1
From: Christina Fu <cfu@redhat.com>
2413b1
Date: Mon, 16 Apr 2018 14:28:39 -0700
2413b1
Subject: [PATCH 1/7] Ticket #2940 post-ticket simple typo fix.
2413b1
2413b1
Change-Id: I98558f607cb611981bcafd42d6500fd26a9664be
2413b1
(cherry picked from commit 2e299050016094c4ab9b739bc68a27787d8aadb4)
2413b1
(cherry picked from commit 7ed0b12aa3bc9a04acd417fc0757500d585c57e8)
2413b1
---
2413b1
 base/java-tools/man/man1/CMCSharedToken.1 | 4 ++--
2413b1
 1 file changed, 2 insertions(+), 2 deletions(-)
2413b1
2413b1
diff --git a/base/java-tools/man/man1/CMCSharedToken.1 b/base/java-tools/man/man1/CMCSharedToken.1
2413b1
index e4a26f0..64c97f8 100644
2413b1
--- a/base/java-tools/man/man1/CMCSharedToken.1
2413b1
+++ b/base/java-tools/man/man1/CMCSharedToken.1
2413b1
@@ -48,7 +48,7 @@ Security token name (default: internal)
2413b1
 Security token password.
2413b1
 
2413b1
 .TP
2413b1
-.B -p <passphrase>
2413b1
+.B -s <passphrase>
2413b1
 CMC enrollment passphrase (shared secret) (put in "" if containing spaces)
2413b1
 
2413b1
 .TP
2413b1
@@ -56,7 +56,7 @@ CMC enrollment passphrase (shared secret) (put in "" if containing spaces)
2413b1
 PEM issuance protection certificate. Note: only one of the -b or -n options should be used.
2413b1
 
2413b1
 .TP
2413b1
-.B -n <issuance protection cer nicknamet>
2413b1
+.B -n <issuance protection cert nickname>
2413b1
 PEM issuance protection certificate on token. Note: only one of the -b or -n options should be used.
2413b1
 
2413b1
 .TP
2413b1
-- 
2413b1
1.8.3.1
2413b1
2413b1
2413b1
From b189ac5a9fe0eee529893ca1b3616a12fd1d0631 Mon Sep 17 00:00:00 2001
2413b1
From: Christina Fu <cfu@redhat.com>
2413b1
Date: Thu, 19 Apr 2018 17:11:34 -0700
2413b1
Subject: [PATCH 2/7] Ticket #2992 servlet profileSubmitCMCSimple throws NPE
2413b1
2413b1
This patch addresses the issue that when auth.instance_id is not specified in
2413b1
the profile, NPE is thrown.
2413b1
Alternative is to add auth.instance_id value, but it's better to leave this
2413b1
as manual approval only without changing the functionality.
2413b1
2413b1
fixes https://pagure.io/dogtagpki/issue/2992
2413b1
2413b1
Change-Id: I0a3afca1c66af96917a81c94b088d792f0332a4d
2413b1
(cherry picked from commit 203db212a3dce216687dd2aac349fe37d2e92a96)
2413b1
---
2413b1
 .../com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java    | 5 ++++-
2413b1
 1 file changed, 4 insertions(+), 1 deletion(-)
2413b1
2413b1
diff --git a/base/server/cms/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java b/base/server/cms/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java
2413b1
index 91a26b1..a0bcfb5 100644
2413b1
--- a/base/server/cms/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java
2413b1
+++ b/base/server/cms/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java
2413b1
@@ -509,7 +509,10 @@ public class ProfileSubmitCMCServlet extends ProfileServlet {
2413b1
             CMS.debug("ProfileSubmitCMCServlet: null it out");
2413b1
             ctx.set(IAuthManager.CRED_CMC_SIGNING_CERT, "");
2413b1
         }
2413b1
-        String signingCertSerialS = (String) authToken.get(IAuthManager.CRED_CMC_SIGNING_CERT);
2413b1
+        String signingCertSerialS = null;
2413b1
+        if (authToken != null) {
2413b1
+            signingCertSerialS = (String) authToken.get(IAuthManager.CRED_CMC_SIGNING_CERT);
2413b1
+        }
2413b1
         if (signingCertSerialS != null) {
2413b1
             CMS.debug("ProfileSubmitCMCServlet: setting CRED_CMC_SIGNING_CERT in ctx for CMCUserSignedAuth");
2413b1
             ctx.set(IAuthManager.CRED_CMC_SIGNING_CERT, signingCertSerialS);
2413b1
-- 
2413b1
1.8.3.1
2413b1
2413b1
2413b1
From ff37277ba6ee49e92f9bad078f23e66b79315535 Mon Sep 17 00:00:00 2001
2413b1
From: "Endi S. Dewata" <edewata@redhat.com>
2413b1
Date: Tue, 24 Apr 2018 02:44:15 +0200
2413b1
Subject: [PATCH 3/7] Fixed token name normalization in pki-server
2413b1
 subsystem-cert-validate
2413b1
2413b1
The pki-server subsystem-cert-validate has been modified to
2413b1
normalize cert token name before calling pki client-cert-validate.
2413b1
This way "Internal Key Storage Token" will be considered as an
2413b1
internal token and no longer specified as a parameter.
2413b1
2413b1
https://pagure.io/dogtagpki/issue/2997
2413b1
2413b1
Change-Id: I452d8e4b404086c3add6b52a9aa2acd2993d7e97
2413b1
(cherry picked from commit d61f9729dcc102c9acbbaa8129fffb6c30fb7116)
2413b1
---
2413b1
 base/common/python/pki/nssdb.py                | 27 +++++++++++++++++++++-----
2413b1
 base/server/python/pki/server/__init__.py      |  7 +++++++
2413b1
 base/server/python/pki/server/cli/subsystem.py |  3 +++
2413b1
 base/server/sbin/pkidestroy                    | 13 +++++++++++--
2413b1
 base/server/sbin/pkispawn                      | 10 ++++++++++
2413b1
 5 files changed, 53 insertions(+), 7 deletions(-)
2413b1
2413b1
diff --git a/base/common/python/pki/nssdb.py b/base/common/python/pki/nssdb.py
2413b1
index 934fe8b..0f3c97a 100644
2413b1
--- a/base/common/python/pki/nssdb.py
2413b1
+++ b/base/common/python/pki/nssdb.py
2413b1
@@ -43,6 +43,9 @@ CERT_FOOTER = '-----END CERTIFICATE-----'
2413b1
 PKCS7_HEADER = '-----BEGIN PKCS7-----'
2413b1
 PKCS7_FOOTER = '-----END PKCS7-----'
2413b1
 
2413b1
+INTERNAL_TOKEN_NAME = 'internal'
2413b1
+INTERNAL_TOKEN_FULL_NAME = 'Internal Key Storage Token'
2413b1
+
2413b1
 logger = logging.LoggerAdapter(
2413b1
     logging.getLogger(__name__),
2413b1
     extra={'indent': ''})
2413b1
@@ -112,6 +115,24 @@ def get_file_type(filename):
2413b1
     return None
2413b1
 
2413b1
 
2413b1
+def normalize_token(token):
2413b1
+    """
2413b1
+    Normalize internal token name (e.g. empty string, 'internal',
2413b1
+    'Internal Key Storage Token') into None. Other token names
2413b1
+    will be unchanged.
2413b1
+    """
2413b1
+    if not token:
2413b1
+        return None
2413b1
+
2413b1
+    if token.lower() == INTERNAL_TOKEN_NAME:
2413b1
+        return None
2413b1
+
2413b1
+    if token.lower() == INTERNAL_TOKEN_FULL_NAME.lower():
2413b1
+        return None
2413b1
+
2413b1
+    return token
2413b1
+
2413b1
+
2413b1
 class NSSDatabase(object):
2413b1
 
2413b1
     def __init__(self, directory=None, token=None, password=None,
2413b1
@@ -123,11 +144,7 @@ class NSSDatabase(object):
2413b1
                 os.path.expanduser("~"), '.dogtag', 'nssdb')
2413b1
 
2413b1
         self.directory = directory
2413b1
-
2413b1
-        if token == 'internal' or token == 'Internal Key Storage Token':
2413b1
-            self.token = None
2413b1
-        else:
2413b1
-            self.token = token
2413b1
+        self.token = normalize_token(token)
2413b1
 
2413b1
         self.tmpdir = tempfile.mkdtemp()
2413b1
 
2413b1
diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py
2413b1
index 65aee2f..b5180f0 100644
2413b1
--- a/base/server/python/pki/server/__init__.py
2413b1
+++ b/base/server/python/pki/server/__init__.py
2413b1
@@ -28,6 +28,7 @@ import grp
2413b1
 import io
2413b1
 import ldap
2413b1
 import ldap.filter
2413b1
+import logging
2413b1
 import operator
2413b1
 import os
2413b1
 import pwd
2413b1
@@ -50,6 +51,10 @@ SUBSYSTEM_CLASSES = {}
2413b1
 
2413b1
 SELFTEST_CRITICAL = 'critical'
2413b1
 
2413b1
+logger = logging.LoggerAdapter(
2413b1
+    logging.getLogger(__name__),
2413b1
+    extra={'indent': ''})
2413b1
+
2413b1
 
2413b1
 class PKIServer(object):
2413b1
 
2413b1
@@ -206,6 +211,8 @@ class PKISubsystem(object):
2413b1
         if cert_id:
2413b1
             cmd.append(cert_id)
2413b1
 
2413b1
+        logger.debug('Command: %s', ' '.join(cmd))
2413b1
+
2413b1
         subprocess.check_output(
2413b1
             cmd,
2413b1
             stderr=subprocess.STDOUT)
2413b1
diff --git a/base/server/python/pki/server/cli/subsystem.py b/base/server/python/pki/server/cli/subsystem.py
2413b1
index 0abf90a..57093d4 100644
2413b1
--- a/base/server/python/pki/server/cli/subsystem.py
2413b1
+++ b/base/server/python/pki/server/cli/subsystem.py
2413b1
@@ -1000,6 +1000,9 @@ class SubsystemCertValidateCLI(pki.cli.CLI):
2413b1
         token = cert.get('token', '')
2413b1
         print('  Token: %s' % token)
2413b1
 
2413b1
+        # normalize internal token into None
2413b1
+        token = pki.nssdb.normalize_token(token)
2413b1
+
2413b1
         # get token password and store in temporary file
2413b1
         passwd = instance.get_token_password(token)
2413b1
 
2413b1
diff --git a/base/server/sbin/pkidestroy b/base/server/sbin/pkidestroy
2413b1
index 4df74a4..58f0541 100755
2413b1
--- a/base/server/sbin/pkidestroy
2413b1
+++ b/base/server/sbin/pkidestroy
2413b1
@@ -24,6 +24,7 @@ from __future__ import absolute_import
2413b1
 from __future__ import print_function
2413b1
 import sys
2413b1
 import signal
2413b1
+import subprocess
2413b1
 
2413b1
 if not hasattr(sys, "hexversion") or sys.hexversion < 0x020700f0:
2413b1
     print("Python version %s.%s.%s is too old." % sys.version_info[:3])
2413b1
@@ -235,8 +236,16 @@ def main(argv):
2413b1
 
2413b1
             scriptlet.destroy(deployer)
2413b1
 
2413b1
-    # pylint: disable=W0703
2413b1
-    except Exception as e:
2413b1
+    except subprocess.CalledProcessError as e:
2413b1
+        log_error_details()
2413b1
+        print()
2413b1
+        print("Uninstallation failed: Command failed: %s" % ' '.join(e.cmd))
2413b1
+        if e.output:
2413b1
+            print(e.output)
2413b1
+        print()
2413b1
+        sys.exit(1)
2413b1
+
2413b1
+    except Exception as e:  # pylint: disable=broad-except
2413b1
         log_error_details()
2413b1
         print()
2413b1
         print("Uninstallation failed: %s" % e)
2413b1
diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn
2413b1
index b2ac8b4..ab94b8b 100755
2413b1
--- a/base/server/sbin/pkispawn
2413b1
+++ b/base/server/sbin/pkispawn
2413b1
@@ -24,6 +24,7 @@ from __future__ import absolute_import
2413b1
 from __future__ import print_function
2413b1
 import sys
2413b1
 import signal
2413b1
+import subprocess
2413b1
 
2413b1
 if not hasattr(sys, "hexversion") or sys.hexversion < 0x020700f0:
2413b1
     print("Python version %s.%s.%s is too old." % sys.version_info[:3])
2413b1
@@ -549,6 +550,15 @@ def main(argv):
2413b1
 
2413b1
         sys.exit(1)
2413b1
 
2413b1
+    except subprocess.CalledProcessError as e:
2413b1
+        log_error_details()
2413b1
+        print()
2413b1
+        print("Installation failed: Command failed: %s" % ' '.join(e.cmd))
2413b1
+        if e.output:
2413b1
+            print(e.output)
2413b1
+        print()
2413b1
+        sys.exit(1)
2413b1
+
2413b1
     except Exception as e:  # pylint: disable=broad-except
2413b1
         log_error_details()
2413b1
         print()
2413b1
-- 
2413b1
1.8.3.1
2413b1
2413b1
2413b1
From 5df4e1a9418a9d276170c0c9c8bdec2f0de0d759 Mon Sep 17 00:00:00 2001
2413b1
From: Christina Fu <cfu@redhat.com>
2413b1
Date: Tue, 15 May 2018 19:06:48 -0700
2413b1
Subject: [PATCH 4/7] Ticket 1741 ECDSA Signature Algorithm encoding
2413b1
2413b1
This patch addresses part of the issue where params were in the AlgorithmIdentifier of the ECDSA signature algorithm. The JSS portion is addressed by https://pagure.io/jss/issue/3
2413b1
2413b1
Fixes https://pagure.io/dogtagpki/issue/1741
2413b1
2413b1
Change-Id: I5dfea6eb2ca4711da2a983382c3f6607d95f3e0d
2413b1
(cherry picked from commit 01dcdee01ab9c231e89169e422e452ce5ef22257)
2413b1
---
2413b1
 base/util/src/netscape/security/x509/AlgorithmId.java | 11 ++++++++++-
2413b1
 1 file changed, 10 insertions(+), 1 deletion(-)
2413b1
2413b1
diff --git a/base/util/src/netscape/security/x509/AlgorithmId.java b/base/util/src/netscape/security/x509/AlgorithmId.java
2413b1
index a89843e..ae5975a 100644
2413b1
--- a/base/util/src/netscape/security/x509/AlgorithmId.java
2413b1
+++ b/base/util/src/netscape/security/x509/AlgorithmId.java
2413b1
@@ -142,7 +142,16 @@ public class AlgorithmId implements Serializable, DerEncoder {
2413b1
          * Figure out what class (if any) knows about this oid's
2413b1
          * parameters.  Make one, and give it the data to decode.
2413b1
          */
2413b1
-        AlgorithmId alg = new AlgorithmId(algid, params);
2413b1
+        AlgorithmId alg = null;
2413b1
+        // omit parameter field for ECDSA
2413b1
+        if (!algid.equals(sha224WithEC_oid) &&
2413b1
+                !algid.equals(sha256WithEC_oid) &&
2413b1
+                !algid.equals(sha384WithEC_oid) &&
2413b1
+                !algid.equals(sha512WithEC_oid)) {
2413b1
+            alg = new AlgorithmId(algid, params);
2413b1
+        } else {
2413b1
+            alg = new AlgorithmId(algid);
2413b1
+        }
2413b1
         if (params != null)
2413b1
             alg.decodeParams();
2413b1
 
2413b1
-- 
2413b1
1.8.3.1
2413b1
2413b1
2413b1
From e4324c4fe54c8b139fbb522c1ad899579ce0aaec Mon Sep 17 00:00:00 2001
2413b1
From: Christina Fu <cfu@redhat.com>
2413b1
Date: Wed, 16 May 2018 14:52:21 -0700
2413b1
Subject: [PATCH 5/7] Ticket 3018 CMC profiles: Some CMC profiles have wrong
2413b1
 input class_id
2413b1
2413b1
This patch fixes the profile input area where
2413b1
cmcCertReqInputImpl should replace certReqInputImpl
2413b1
and submitterInfoInputImpl should not be present
2413b1
2413b1
fixes https://pagure.io/dogtagpki/issue/3018
2413b1
2413b1
Change-Id: Id4e03961110b19b2c73ebd9def89919d5dd3b0ad
2413b1
(cherry picked from commit ac8c853ed9b06f4dfdbeb4d00f3f425f5d479824)
2413b1
---
2413b1
 base/ca/shared/profiles/ca/caCMCECUserCert.cfg           | 3 +--
2413b1
 base/ca/shared/profiles/ca/caCMCECserverCert.cfg         | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCECsubsystemCert.cfg      | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCUserCert.cfg             | 3 +--
2413b1
 base/ca/shared/profiles/ca/caCMCauditSigningCert.cfg     | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCcaCert.cfg               | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCkraStorageCert.cfg       | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCkraTransportCert.cfg     | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCocspCert.cfg             | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCserverCert.cfg           | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caCMCsubsystemCert.cfg        | 5 ++---
2413b1
 base/ca/shared/profiles/ca/caECFullCMCSelfSignedCert.cfg | 3 +--
2413b1
 base/ca/shared/profiles/ca/caECFullCMCUserCert.cfg       | 3 +--
2413b1
 base/ca/shared/profiles/ca/caECFullCMCUserSignedCert.cfg | 3 +--
2413b1
 base/ca/shared/profiles/ca/caECSimpleCMCUserCert.cfg     | 2 +-
2413b1
 base/ca/shared/profiles/ca/caFullCMCSelfSignedCert.cfg   | 3 +--
2413b1
 base/ca/shared/profiles/ca/caFullCMCUserCert.cfg         | 3 +--
2413b1
 base/ca/shared/profiles/ca/caFullCMCUserSignedCert.cfg   | 3 +--
2413b1
 base/ca/shared/profiles/ca/caSimpleCMCUserCert.cfg       | 2 +-
2413b1
 19 files changed, 28 insertions(+), 45 deletions(-)
2413b1
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCECUserCert.cfg b/base/ca/shared/profiles/ca/caCMCECUserCert.cfg
2413b1
index 5185891..b7b4881 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCECUserCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCECUserCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Signed CMC-Authenticated User Certificate wth ECC keys Enrollment
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCECserverCert.cfg b/base/ca/shared/profiles/ca/caCMCECserverCert.cfg
2413b1
index 158d9fe..53b0c4d 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCECserverCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCECserverCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Server Certificate wth ECC keys Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCECsubsystemCert.cfg b/base/ca/shared/profiles/ca/caCMCECsubsystemCert.cfg
2413b1
index f755243..6e41e06 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCECsubsystemCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCECsubsystemCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Subsystem Certificate Enrollment with ECC keys using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCUserCert.cfg b/base/ca/shared/profiles/ca/caCMCUserCert.cfg
2413b1
index fe2a8b3..df47758 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCUserCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCUserCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Signed CMC-Authenticated User Certificate Enrollment
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCauditSigningCert.cfg b/base/ca/shared/profiles/ca/caCMCauditSigningCert.cfg
2413b1
index 967d6ef..ff4856c 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCauditSigningCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCauditSigningCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Audit Signing Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=auditSigningCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCcaCert.cfg b/base/ca/shared/profiles/ca/caCMCcaCert.cfg
2413b1
index 49a356d..bf6c59a 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCcaCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCcaCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Certificate Manager Signing Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=caCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCkraStorageCert.cfg b/base/ca/shared/profiles/ca/caCMCkraStorageCert.cfg
2413b1
index bbe733a..1c2630d 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCkraStorageCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCkraStorageCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=KRA storage Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=drmStorageCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCkraTransportCert.cfg b/base/ca/shared/profiles/ca/caCMCkraTransportCert.cfg
2413b1
index 60b19bf..3d00408 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCkraTransportCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCkraTransportCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Key Archival Authority Transport Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=transportCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCocspCert.cfg b/base/ca/shared/profiles/ca/caCMCocspCert.cfg
2413b1
index cd60562..14464bf 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCocspCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCocspCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=OCSP Responder Signing Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=ocspCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCserverCert.cfg b/base/ca/shared/profiles/ca/caCMCserverCert.cfg
2413b1
index 89bbbea..9ad9fac 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCserverCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCserverCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Server Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caCMCsubsystemCert.cfg b/base/ca/shared/profiles/ca/caCMCsubsystemCert.cfg
2413b1
index 4a922fc..c25ed79 100644
2413b1
--- a/base/ca/shared/profiles/ca/caCMCsubsystemCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caCMCsubsystemCert.cfg
2413b1
@@ -5,9 +5,8 @@ enableBy=admin
2413b1
 auth.instance_id=CMCAuth
2413b1
 authz.acl=group="Certificate Manager Agents"
2413b1
 name=Subsystem Certificate Enrollment using CMC
2413b1
-input.list=i1,i2
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
+input.list=i1
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caECFullCMCSelfSignedCert.cfg b/base/ca/shared/profiles/ca/caECFullCMCSelfSignedCert.cfg
2413b1
index 816a1f8..d0a3c25 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECFullCMCSelfSignedCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECFullCMCSelfSignedCert.cfg
2413b1
@@ -4,9 +4,8 @@ enableBy=admin
2413b1
 name=Self-Signed CMC User Certificate Enrollment
2413b1
 visible=false
2413b1
 auth.instance_id=CMCUserSignedAuth
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caECFullCMCUserCert.cfg b/base/ca/shared/profiles/ca/caECFullCMCUserCert.cfg
2413b1
index 0116053..469dbb0 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECFullCMCUserCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECFullCMCUserCert.cfg
2413b1
@@ -4,9 +4,8 @@ enableBy=admin
2413b1
 name=Agent-Signed CMC-Authenticated User Certificate Enrollment
2413b1
 visible=false
2413b1
 auth.instance_id=CMCAuth
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caECFullCMCUserSignedCert.cfg b/base/ca/shared/profiles/ca/caECFullCMCUserSignedCert.cfg
2413b1
index a15aa53..d2286de 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECFullCMCUserSignedCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECFullCMCUserSignedCert.cfg
2413b1
@@ -4,9 +4,8 @@ enableBy=admin
2413b1
 name=User-Signed CMC-Authenticated User Certificate Enrollment
2413b1
 visible=false
2413b1
 auth.instance_id=CMCUserSignedAuth
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caECSimpleCMCUserCert.cfg b/base/ca/shared/profiles/ca/caECSimpleCMCUserCert.cfg
2413b1
index 14d610c..64a6ad9 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECSimpleCMCUserCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECSimpleCMCUserCert.cfg
2413b1
@@ -5,7 +5,7 @@ name=Simple CMC Enrollment Request for User Certificate
2413b1
 visible=false
2413b1
 auth.instance_id=
2413b1
 input.list=i1
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caFullCMCSelfSignedCert.cfg b/base/ca/shared/profiles/ca/caFullCMCSelfSignedCert.cfg
2413b1
index 1a7c22d..6b2da33 100644
2413b1
--- a/base/ca/shared/profiles/ca/caFullCMCSelfSignedCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caFullCMCSelfSignedCert.cfg
2413b1
@@ -4,9 +4,8 @@ enableBy=admin
2413b1
 name=Self-Signed CMC User Certificate Enrollment
2413b1
 visible=false
2413b1
 auth.instance_id=CMCUserSignedAuth
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caFullCMCUserCert.cfg b/base/ca/shared/profiles/ca/caFullCMCUserCert.cfg
2413b1
index b06f35d..dd336ad 100644
2413b1
--- a/base/ca/shared/profiles/ca/caFullCMCUserCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caFullCMCUserCert.cfg
2413b1
@@ -4,9 +4,8 @@ enableBy=admin
2413b1
 name=Agent-Signed CMC-Authenticated User Certificate Enrollment
2413b1
 visible=false
2413b1
 auth.instance_id=CMCAuth
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caFullCMCUserSignedCert.cfg b/base/ca/shared/profiles/ca/caFullCMCUserSignedCert.cfg
2413b1
index 0c2b97b..9b5d3e9 100644
2413b1
--- a/base/ca/shared/profiles/ca/caFullCMCUserSignedCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caFullCMCUserSignedCert.cfg
2413b1
@@ -4,9 +4,8 @@ enableBy=admin
2413b1
 name=User-Signed CMC-Authenticated User Certificate Enrollment
2413b1
 visible=false
2413b1
 auth.instance_id=CMCUserSignedAuth
2413b1
-input.list=i1,i2
2413b1
+input.list=i1
2413b1
 input.i1.class_id=cmcCertReqInputImpl
2413b1
-input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
diff --git a/base/ca/shared/profiles/ca/caSimpleCMCUserCert.cfg b/base/ca/shared/profiles/ca/caSimpleCMCUserCert.cfg
2413b1
index a9c2b0c..0628a36 100644
2413b1
--- a/base/ca/shared/profiles/ca/caSimpleCMCUserCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caSimpleCMCUserCert.cfg
2413b1
@@ -5,7 +5,7 @@ name=Simple CMC Enrollment Request for User Certificate
2413b1
 visible=false
2413b1
 auth.instance_id=
2413b1
 input.list=i1
2413b1
-input.i1.class_id=certReqInputImpl
2413b1
+input.i1.class_id=cmcCertReqInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=cmcUserCertSet
2413b1
-- 
2413b1
1.8.3.1
2413b1
2413b1
2413b1
From b66e3a729b0413d8851b6d5a875c6f6542823463 Mon Sep 17 00:00:00 2001
2413b1
From: Christina Fu <cfu@redhat.com>
2413b1
Date: Thu, 17 May 2018 19:36:10 -0700
2413b1
Subject: [PATCH 6/7] Ticket #2995 SAN in internal SSL server certificate in
2413b1
 pkispawn configuration step
2413b1
2413b1
This patch adds CommonNameToSANDefault to all server profiles so that
2413b1
SAN will be placed in server certs by default.
2413b1
For more flexible SAN or multi-value SAN, SubjectAltNameExtDefault
2413b1
will have to be used instead.
2413b1
2413b1
fixes: https://pagure.io/dogtagpki/issue/2995
2413b1
2413b1
Change-Id: I66556f2cb8ed4e1cbe2d0949c5848c6978ea9641
2413b1
(cherry picked from commit 7eae0d840c1b7494db2cea67744366fe409eafea)
2413b1
---
2413b1
 base/ca/shared/conf/serverCert.profile                 |  4 +++-
2413b1
 base/ca/shared/profiles/ca/caAgentServerCert.cfg       |  6 +++++-
2413b1
 base/ca/shared/profiles/ca/caECAgentServerCert.cfg     |  6 +++++-
2413b1
 .../shared/profiles/ca/caECInternalAuthServerCert.cfg  | 18 +++++++++++++++++-
2413b1
 base/ca/shared/profiles/ca/caECServerCert.cfg          |  6 +++++-
2413b1
 .../ca/shared/profiles/ca/caInternalAuthServerCert.cfg | 18 +++++++++++++++++-
2413b1
 base/ca/shared/profiles/ca/caServerCert.cfg            |  6 +++++-
2413b1
 7 files changed, 57 insertions(+), 7 deletions(-)
2413b1
2413b1
diff --git a/base/ca/shared/conf/serverCert.profile b/base/ca/shared/conf/serverCert.profile
2413b1
index 3674cbc..e740760 100644
2413b1
--- a/base/ca/shared/conf/serverCert.profile
2413b1
+++ b/base/ca/shared/conf/serverCert.profile
2413b1
@@ -6,7 +6,7 @@ name=All Purpose SSL server cert Profile
2413b1
 description=This profile creates an SSL server certificate that is valid for SSL servers
2413b1
 profileIDMapping=caServerCert
2413b1
 profileSetIDMapping=serverCertSet
2413b1
-list=2,4,5,6,7
2413b1
+list=2,4,5,6,7,8
2413b1
 2.default.class=com.netscape.cms.profile.def.ValidityDefault
2413b1
 2.default.name=Validity Default
2413b1
 2.default.params.range=720
2413b1
@@ -37,3 +37,5 @@ list=2,4,5,6,7
2413b1
 7.default.name=Extended Key Usage Extension Default
2413b1
 7.default.params.exKeyUsageCritical=false
2413b1
 7.default.params.exKeyUsageOIDs=1.3.6.1.5.5.7.3.1
2413b1
+8.default.class=com.netscape.cms.profile.def.CommonNameToSANDefault
2413b1
+8.default.name=Copy Common Name to Subjec Alternative Name Extension
2413b1
diff --git a/base/ca/shared/profiles/ca/caAgentServerCert.cfg b/base/ca/shared/profiles/ca/caAgentServerCert.cfg
2413b1
index c4d109f..0662b0a 100644
2413b1
--- a/base/ca/shared/profiles/ca/caAgentServerCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caAgentServerCert.cfg
2413b1
@@ -10,7 +10,7 @@ input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
-policyset.serverCertSet.list=1,2,3,4,5,6,7,8
2413b1
+policyset.serverCertSet.list=1,2,3,4,5,6,7,8,12
2413b1
 policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl
2413b1
 policyset.serverCertSet.1.constraint.name=Subject Name Constraint
2413b1
 policyset.serverCertSet.1.constraint.params.pattern=CN=.*
2413b1
@@ -83,3 +83,7 @@ policyset.serverCertSet.8.constraint.params.signingAlgsAllowed=SHA256withRSA,SHA
2413b1
 policyset.serverCertSet.8.default.class_id=signingAlgDefaultImpl
2413b1
 policyset.serverCertSet.8.default.name=Signing Alg
2413b1
 policyset.serverCertSet.8.default.params.signingAlg=-
2413b1
+policyset.serverCertSet.12.constraint.class_id=noConstraintImpl
2413b1
+policyset.serverCertSet.12.constraint.name=No Constraint
2413b1
+policyset.serverCertSet.12.default.class_id=commonNameToSANDefaultImpl
2413b1
+policyset.serverCertSet.12.default.name=Copy Common Name to Subject Alternative Name Extension
2413b1
diff --git a/base/ca/shared/profiles/ca/caECAgentServerCert.cfg b/base/ca/shared/profiles/ca/caECAgentServerCert.cfg
2413b1
index c56b6de..da4811e 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECAgentServerCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECAgentServerCert.cfg
2413b1
@@ -10,7 +10,7 @@ input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
-policyset.serverCertSet.list=1,2,3,4,5,6,7,8
2413b1
+policyset.serverCertSet.list=1,2,3,4,5,6,7,8,12
2413b1
 policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl
2413b1
 policyset.serverCertSet.1.constraint.name=Subject Name Constraint
2413b1
 policyset.serverCertSet.1.constraint.params.pattern=CN=.*
2413b1
@@ -83,3 +83,7 @@ policyset.serverCertSet.8.constraint.params.signingAlgsAllowed=SHA256withRSA,SHA
2413b1
 policyset.serverCertSet.8.default.class_id=signingAlgDefaultImpl
2413b1
 policyset.serverCertSet.8.default.name=Signing Alg
2413b1
 policyset.serverCertSet.8.default.params.signingAlg=-
2413b1
+policyset.serverCertSet.12.constraint.class_id=noConstraintImpl
2413b1
+policyset.serverCertSet.12.constraint.name=No Constraint
2413b1
+policyset.serverCertSet.12.default.class_id=commonNameToSANDefaultImpl
2413b1
+policyset.serverCertSet.12.default.name=Copy Common Name to Subject Alternative Name Extension
2413b1
diff --git a/base/ca/shared/profiles/ca/caECInternalAuthServerCert.cfg b/base/ca/shared/profiles/ca/caECInternalAuthServerCert.cfg
2413b1
index 4fc8a9c..8580544 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECInternalAuthServerCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECInternalAuthServerCert.cfg
2413b1
@@ -12,7 +12,7 @@ input.i3.class_id=subjectAltNameExtInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
-policyset.serverCertSet.list=1,2,3,4,5,6,7,8
2413b1
+policyset.serverCertSet.list=1,2,3,4,5,6,7,8,12
2413b1
 policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl
2413b1
 policyset.serverCertSet.1.constraint.name=Subject Name Constraint
2413b1
 policyset.serverCertSet.1.constraint.params.pattern=CN=.*
2413b1
@@ -92,6 +92,10 @@ policyset.serverCertSet.8.default.params.signingAlg=-
2413b1
 # 3. change below to reflect the number of general names, and
2413b1
 #    turn each corresponding subjAltExtPattern_<num> to true
2413b1
 #      policyset.serverCertSet.9.default.params.subjAltNameNumGNs
2413b1
+#
2413b1
+# If the subjectAltNameExtDefaultImpl is on, then commonNameToSANDefault
2413b1
+# would "merge" into existing SAN.  Keep commonNameToSANDefault as last entry
2413b1
+#
2413b1
 policyset.serverCertSet.9.constraint.class_id=noConstraintImpl
2413b1
 policyset.serverCertSet.9.constraint.name=No Constraint
2413b1
 policyset.serverCertSet.9.default.class_id=subjectAltNameExtDefaultImpl
2413b1
@@ -107,3 +111,15 @@ policyset.serverCertSet.9.default.params.subjAltExtPattern_2=$request.req_san_pa
2413b1
 policyset.serverCertSet.9.default.params.subjAltExtType_2=DNSName
2413b1
 policyset.serverCertSet.9.default.params.subjAltNameExtCritical=false
2413b1
 policyset.serverCertSet.9.default.params.subjAltNameNumGNs=1
2413b1
+#
2413b1
+# While the subjectAltNameExtDefaultImpl above allows multiple SANs to be
2413b1
+# specified during installation, the commonNameToSANDefaultImpl adds a simple
2413b1
+# default single SAN from CN.
2413b1
+#
2413b1
+# If the subjectAltNameExtDefaultImpl is on, then commonNameToSANDefault
2413b1
+# would "merge" into existing SAN.  Keep commonNameToSANDefault as last entry
2413b1
+#
2413b1
+policyset.serverCertSet.12.constraint.class_id=noConstraintImpl
2413b1
+policyset.serverCertSet.12.constraint.name=No Constraint
2413b1
+policyset.serverCertSet.12.default.class_id=commonNameToSANDefaultImpl
2413b1
+policyset.serverCertSet.12.default.name=Copy Common Name to Subject Alternative Name Extension
2413b1
diff --git a/base/ca/shared/profiles/ca/caECServerCert.cfg b/base/ca/shared/profiles/ca/caECServerCert.cfg
2413b1
index 0ae4371..7517a5f 100644
2413b1
--- a/base/ca/shared/profiles/ca/caECServerCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caECServerCert.cfg
2413b1
@@ -10,7 +10,7 @@ input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
-policyset.serverCertSet.list=1,2,3,4,5,6,7,8
2413b1
+policyset.serverCertSet.list=1,2,3,4,5,6,7,8,12
2413b1
 policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl
2413b1
 policyset.serverCertSet.1.constraint.name=Subject Name Constraint
2413b1
 policyset.serverCertSet.1.constraint.params.pattern=.*CN=.*
2413b1
@@ -83,3 +83,7 @@ policyset.serverCertSet.8.constraint.params.signingAlgsAllowed=SHA256withRSA,SHA
2413b1
 policyset.serverCertSet.8.default.class_id=signingAlgDefaultImpl
2413b1
 policyset.serverCertSet.8.default.name=Signing Alg
2413b1
 policyset.serverCertSet.8.default.params.signingAlg=-
2413b1
+policyset.serverCertSet.12.constraint.class_id=noConstraintImpl
2413b1
+policyset.serverCertSet.12.constraint.name=No Constraint
2413b1
+policyset.serverCertSet.12.default.class_id=commonNameToSANDefaultImpl
2413b1
+policyset.serverCertSet.12.default.name=Copy Common Name to Subject Alternative Name Extension
2413b1
diff --git a/base/ca/shared/profiles/ca/caInternalAuthServerCert.cfg b/base/ca/shared/profiles/ca/caInternalAuthServerCert.cfg
2413b1
index dd10f6f..de3c2a5 100644
2413b1
--- a/base/ca/shared/profiles/ca/caInternalAuthServerCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caInternalAuthServerCert.cfg
2413b1
@@ -12,7 +12,7 @@ input.i3.class_id=subjectAltNameExtInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
-policyset.serverCertSet.list=1,2,3,4,5,6,7,8
2413b1
+policyset.serverCertSet.list=1,2,3,4,5,6,7,8,12
2413b1
 policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl
2413b1
 policyset.serverCertSet.1.constraint.name=Subject Name Constraint
2413b1
 policyset.serverCertSet.1.constraint.params.pattern=CN=.*
2413b1
@@ -92,6 +92,10 @@ policyset.serverCertSet.8.default.params.signingAlg=-
2413b1
 # 3. change below to reflect the number of general names, and
2413b1
 #    turn each corresponding subjAltExtPattern_<num> to true
2413b1
 #      policyset.serverCertSet.9.default.params.subjAltNameNumGNs
2413b1
+#
2413b1
+# If the subjectAltNameExtDefaultImpl is on, then commonNameToSANDefault
2413b1
+# would "merge" into existing SAN.  Keep commonNameToSANDefault as last entry
2413b1
+#
2413b1
 policyset.serverCertSet.9.constraint.class_id=noConstraintImpl
2413b1
 policyset.serverCertSet.9.constraint.name=No Constraint
2413b1
 policyset.serverCertSet.9.default.class_id=subjectAltNameExtDefaultImpl
2413b1
@@ -107,3 +111,15 @@ policyset.serverCertSet.9.default.params.subjAltExtPattern_2=$request.req_san_pa
2413b1
 policyset.serverCertSet.9.default.params.subjAltExtType_2=DNSName
2413b1
 policyset.serverCertSet.9.default.params.subjAltNameExtCritical=false
2413b1
 policyset.serverCertSet.9.default.params.subjAltNameNumGNs=1
2413b1
+#
2413b1
+# While the subjectAltNameExtDefaultImpl above allows multiple SANs to be
2413b1
+# specified during installation, the commonNameToSANDefaultImpl adds a simple
2413b1
+# default single SAN from CN.
2413b1
+#
2413b1
+# If the subjectAltNameExtDefaultImpl is on, then commonNameToSANDefault
2413b1
+# would "merge" into existing SAN.  Keep commonNameToSANDefault as last entry
2413b1
+#
2413b1
+policyset.serverCertSet.12.constraint.class_id=noConstraintImpl
2413b1
+policyset.serverCertSet.12.constraint.name=No Constraint
2413b1
+policyset.serverCertSet.12.default.class_id=commonNameToSANDefaultImpl
2413b1
+policyset.serverCertSet.12.default.name=Copy Common Name to Subject Alternative Name Extension
2413b1
diff --git a/base/ca/shared/profiles/ca/caServerCert.cfg b/base/ca/shared/profiles/ca/caServerCert.cfg
2413b1
index 2f44c96..fdb08e4 100644
2413b1
--- a/base/ca/shared/profiles/ca/caServerCert.cfg
2413b1
+++ b/base/ca/shared/profiles/ca/caServerCert.cfg
2413b1
@@ -10,7 +10,7 @@ input.i2.class_id=submitterInfoInputImpl
2413b1
 output.list=o1
2413b1
 output.o1.class_id=certOutputImpl
2413b1
 policyset.list=serverCertSet
2413b1
-policyset.serverCertSet.list=1,2,3,4,5,6,7,8
2413b1
+policyset.serverCertSet.list=1,2,3,4,5,6,7,8,12
2413b1
 policyset.serverCertSet.1.constraint.class_id=subjectNameConstraintImpl
2413b1
 policyset.serverCertSet.1.constraint.name=Subject Name Constraint
2413b1
 policyset.serverCertSet.1.constraint.params.pattern=.*CN=.*
2413b1
@@ -83,3 +83,7 @@ policyset.serverCertSet.8.constraint.params.signingAlgsAllowed=SHA256withRSA,SHA
2413b1
 policyset.serverCertSet.8.default.class_id=signingAlgDefaultImpl
2413b1
 policyset.serverCertSet.8.default.name=Signing Alg
2413b1
 policyset.serverCertSet.8.default.params.signingAlg=-
2413b1
+policyset.serverCertSet.12.constraint.class_id=noConstraintImpl
2413b1
+policyset.serverCertSet.12.constraint.name=No Constraint
2413b1
+policyset.serverCertSet.12.default.class_id=commonNameToSANDefaultImpl
2413b1
+policyset.serverCertSet.12.default.name=Copy Common Name to Subject Alternative Name Extension
2413b1
-- 
2413b1
1.8.3.1
2413b1
2413b1
2413b1
From 1d70d69cc5e17be566867dd2c9e5176be0802e93 Mon Sep 17 00:00:00 2001
2413b1
From: Jack Magne <jmagne@redhat.com>
2413b1
Date: Wed, 16 May 2018 15:28:38 -0700
2413b1
Subject: [PATCH 7/7] Fix  #2996 ECC installation for non CA subsystems needs
2413b1
 improvement.
2413b1
2413b1
The problem is that the installation of say a KRA, which is ECC enabled fails out of the box.
2413b1
2413b1
This is due to the fact that the internal cert profiles for the following certificates is incorrect:
2413b1
2413b1
1. sslserver cert
2413b1
2. subsystem cert
2413b1
3. admin cert
2413b1
2413b1
In the ECC case there is some hard coding that references the well known cert profiles for RSA versions of the above certs.
2413b1
2413b1
What we need in the ECC case is a way to correctly select the ECC versions of the above profiles.
2413b1
Therefore this fix does the following:
2413b1
2413b1
1. Makes the selection of either the ECC version or the RSA version of the above internal cert profiles based on the key type, ecc or rsa. This solution relies upon well known profile names, but can be modified in the future to be more customizable , should the need arise.
2413b1
2413b1
2. I found a related problem when trying to create a ECC enabled KRA in a SHARED instance scenario. There was some final cloning related config code that was grossly RSA specific and throws exceptions when ECC is involved. I altered this piece of code to skip over the bad things with ECC and let the RSA case run unimpeded. We may need further refinement for the ECC case, but I felt this was needed to allow something like an ECC kra to be installed in a shared instance scenario.
2413b1
2413b1
Change-Id: I1493d63fd8ea0157adb8f47ec0d5aaadc2b88b26
2413b1
(cherry picked from commit 530634991d553b25dfe8d4cd861b7f4412ad06ca)
2413b1
---
2413b1
 .../certsrv/system/ConfigurationRequest.java       | 63 +++++++++++++++++++++-
2413b1
 .../cms/servlet/csadmin/ConfigurationUtils.java    | 18 +++++--
2413b1
 .../dogtagpki/server/rest/SystemConfigService.java | 25 +++++++--
2413b1
 3 files changed, 97 insertions(+), 9 deletions(-)
2413b1
2413b1
diff --git a/base/common/src/com/netscape/certsrv/system/ConfigurationRequest.java b/base/common/src/com/netscape/certsrv/system/ConfigurationRequest.java
2413b1
index 5a65f3e..7ea24d2 100644
2413b1
--- a/base/common/src/com/netscape/certsrv/system/ConfigurationRequest.java
2413b1
+++ b/base/common/src/com/netscape/certsrv/system/ConfigurationRequest.java
2413b1
@@ -43,6 +43,16 @@ public class ConfigurationRequest {
2413b1
     public static final String EXISTING_DOMAIN = "existingdomain";
2413b1
     public static final String NEW_SUBDOMAIN = "newsubdomain";
2413b1
 
2413b1
+    // Hard coded values for ECC and RSA internal cert profile names
2413b1
+    public static final String ECC_INTERNAL_SERVER_CERT_PROFILE = "caECInternalAuthServerCert";
2413b1
+    public static final String RSA_INTERNAL_SERVER_CERT_PROFILE = "caInternalAuthServerCert";
2413b1
+
2413b1
+    public static final String ECC_INTERNAL_SUBSYSTEM_CERT_PROFILE= "caECInternalAuthSubsystemCert";
2413b1
+    public static final String RSA_INTERNAL_SUBSYSTEM_CERT_PROFILE= "caInternalAuthSubsystemCert";
2413b1
+
2413b1
+    public static final String ECC_INTERNAL_ADMIN_CERT_PROFILE="caECAdminCert";
2413b1
+    public static final String RSA_INTERNAL_ADMIN_CERT_PROFILE="caAdminCert";
2413b1
+
2413b1
     @XmlElement
2413b1
     protected String pin;
2413b1
 
2413b1
@@ -605,6 +615,42 @@ public class ConfigurationRequest {
2413b1
        return null;
2413b1
    }
2413b1
 
2413b1
+   public String getSystemCertKeyType(String tag) {
2413b1
+       SystemCertData cert = getSystemCert(tag);
2413b1
+       if(cert == null)
2413b1
+           return null;
2413b1
+
2413b1
+       return cert.getKeyType();
2413b1
+   }
2413b1
+
2413b1
+    public String getSystemCertProfileID(String tag, String defaultName) {
2413b1
+        String profileName = defaultName;
2413b1
+        String keyType = getSystemCertKeyType(tag);
2413b1
+
2413b1
+        System.out.println("getSystemCertProfileID tag: " + tag + " defaultName: " + defaultName + " keyType: " + keyType);
2413b1
+        if (keyType == null)
2413b1
+            return profileName;
2413b1
+
2413b1
+        // Hard code for now based on key type.  Method can be changed later to read pkispawn
2413b1
+        // params sent over in the future.
2413b1
+        if ("ecc".equalsIgnoreCase(keyType)) {
2413b1
+            if ("sslserver".equalsIgnoreCase(tag)) {
2413b1
+                profileName = ECC_INTERNAL_SERVER_CERT_PROFILE;
2413b1
+            } else if ("subsystem".equalsIgnoreCase(tag)) {
2413b1
+                profileName = ECC_INTERNAL_SUBSYSTEM_CERT_PROFILE;
2413b1
+            }
2413b1
+        } else if ("rsa".equalsIgnoreCase(keyType)) {
2413b1
+            if ("sslserver".equalsIgnoreCase(tag)) {
2413b1
+                profileName = RSA_INTERNAL_SERVER_CERT_PROFILE;
2413b1
+            } else if ("subsystem".equalsIgnoreCase(tag)) {
2413b1
+                profileName = RSA_INTERNAL_SUBSYSTEM_CERT_PROFILE;
2413b1
+            }
2413b1
+        }
2413b1
+
2413b1
+        System.out.println("getSystemCertProfileID: returning: " + profileName);
2413b1
+        return profileName;
2413b1
+    }
2413b1
+
2413b1
    /**
2413b1
     *
2413b1
     * @param systemCerts
2413b1
@@ -771,7 +817,22 @@ public class ConfigurationRequest {
2413b1
      * @return the adminProfileID
2413b1
      */
2413b1
     public String getAdminProfileID() {
2413b1
-        return adminProfileID;
2413b1
+
2413b1
+        // Modify the value returned based on key type of the
2413b1
+        // subsystem cert. If keyType not found take the default
2413b1
+        // sent over the server. In the future we can make sure
2413b1
+        // the correct value is sent over the server.
2413b1
+        String keyType = this.getSystemCertKeyType("subsystem");
2413b1
+        String actualAdminProfileID = adminProfileID;
2413b1
+        if(keyType != null) {
2413b1
+            if("ecc".equalsIgnoreCase(keyType)) {
2413b1
+                actualAdminProfileID = ECC_INTERNAL_ADMIN_CERT_PROFILE;
2413b1
+            } else if("rsa".equalsIgnoreCase(keyType)) {
2413b1
+                actualAdminProfileID = RSA_INTERNAL_ADMIN_CERT_PROFILE;
2413b1
+            }
2413b1
+        }
2413b1
+
2413b1
+        return actualAdminProfileID;
2413b1
     }
2413b1
 
2413b1
     /**
2413b1
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
2413b1
index 0a5cd2e..7f5341a 100644
2413b1
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
2413b1
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
2413b1
@@ -2568,7 +2568,9 @@ public class ConfigurationUtils {
2413b1
             config.putString("preop.cert.signing.type", "remote");
2413b1
             config.putString("preop.cert.signing.profile", "caInstallCACert");
2413b1
             config.putString("preop.cert.sslserver.type", "remote");
2413b1
-            config.putString("preop.cert.sslserver.profile", "caInternalAuthServerCert");
2413b1
+
2413b1
+            config.putString("preop.cert.sslserver.profile",
2413b1
+                   request.getSystemCertProfileID("sslserver", "caInternalAuthServerCert"));
2413b1
 
2413b1
             // store original caType
2413b1
             original_caType = caType;
2413b1
@@ -2650,6 +2652,8 @@ public class ConfigurationUtils {
2413b1
         String v = config.getString("preop.ca.type", "");
2413b1
 
2413b1
         CMS.debug("configCert: remote CA");
2413b1
+        CMS.debug("confgCert: tag: " + certTag);
2413b1
+
2413b1
         PKCS10 pkcs10 = CertUtil.getPKCS10(config, PCERT_PREFIX, certObj, context);
2413b1
         byte[] binRequest = pkcs10.toByteArray();
2413b1
         String b64Request = CryptoUtil.base64Encode(binRequest);
2413b1
@@ -2671,7 +2675,10 @@ public class ConfigurationUtils {
2413b1
 
2413b1
             MultivaluedMap<String, String> content = new MultivaluedHashMap<String, String>();
2413b1
             content.putSingle("requestor_name", sysType + "-" + machineName + "-" + securePort);
2413b1
-            content.putSingle("profileId", profileId);
2413b1
+            CMS.debug("configRemoteCert: subsystemCert: setting profileId to: " + profileId);
2413b1
+            String actualProfileId = request.getSystemCertProfileID(certTag, profileId);
2413b1
+            CMS.debug("configRemoteCert: subsystemCert: calculated profileId: " + actualProfileId);
2413b1
+            content.putSingle("profileId", actualProfileId);
2413b1
             content.putSingle("cert_request_type", "pkcs10");
2413b1
             content.putSingle("cert_request", b64Request);
2413b1
             content.putSingle("xmlOutput", "true");
2413b1
@@ -2716,7 +2723,12 @@ public class ConfigurationUtils {
2413b1
 
2413b1
             MultivaluedMap<String, String> content = new MultivaluedHashMap<String, String>();
2413b1
             content.putSingle("requestor_name", sysType + "-" + machineName + "-" + securePort);
2413b1
-            content.putSingle("profileId", profileId);
2413b1
+            //Get the correct profile id to send in case it's sslserver type:
2413b1
+            CMS.debug("configRemoteCert: tag: " + certTag + " : setting profileId to: " + profileId);
2413b1
+            String actualProfileId = request.getSystemCertProfileID(certTag, profileId);
2413b1
+            CMS.debug("configRemoteCert: tag: " + certTag + " calculated profileId: " + actualProfileId);
2413b1
+
2413b1
+            content.putSingle("profileId", actualProfileId);
2413b1
             content.putSingle("cert_request_type", "pkcs10");
2413b1
             content.putSingle("cert_request", b64Request);
2413b1
             content.putSingle("xmlOutput", "true");
2413b1
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
2413b1
index 5130a1a..fbfaed2 100644
2413b1
--- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
2413b1
+++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
2413b1
@@ -524,14 +524,27 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
2413b1
             nickname = cdata.getNickname();
2413b1
         }
2413b1
 
2413b1
+        boolean isECC = false;
2413b1
+        String keyType = cdata.getKeyType();
2413b1
+
2413b1
+        CMS.debug("SystemConfigService:updateCloneConfiguration: keyType: " + keyType);
2413b1
+        if("ecc".equalsIgnoreCase(keyType)) {
2413b1
+            isECC = true;
2413b1
+        }
2413b1
         X509Certificate cert = cryptoManager.findCertByNickname(nickname);
2413b1
         PublicKey pubk = cert.getPublicKey();
2413b1
-        byte[] exponent = CryptoUtil.getPublicExponent(pubk);
2413b1
-        byte[] modulus = CryptoUtil.getModulus(pubk);
2413b1
+        byte[] exponent = null;
2413b1
+        byte[] modulus = null;
2413b1
+
2413b1
+        if (isECC == false) {
2413b1
+            exponent = CryptoUtil.getPublicExponent(pubk);
2413b1
+            modulus = CryptoUtil.getModulus(pubk);
2413b1
+            cs.putString("preop.cert." + tag + ".pubkey.modulus", CryptoUtil.byte2string(modulus));
2413b1
+            cs.putString("preop.cert." + tag + ".pubkey.exponent", CryptoUtil.byte2string(exponent));
2413b1
+        }
2413b1
+
2413b1
         PrivateKey privk = cryptoManager.findPrivKeyByCert(cert);
2413b1
 
2413b1
-        cs.putString("preop.cert." + tag + ".pubkey.modulus", CryptoUtil.byte2string(modulus));
2413b1
-        cs.putString("preop.cert." + tag + ".pubkey.exponent", CryptoUtil.byte2string(exponent));
2413b1
         cs.putString("preop.cert." + tag + ".privkey.id", CryptoUtil.encodeKeyID(privk.getUniqueID()));
2413b1
         cs.putString("preop.cert." + tag + ".keyalgorithm", cdata.getKeyAlgorithm());
2413b1
         cs.putString("preop.cert." + tag + ".keytype", cdata.getKeyType());
2413b1
@@ -606,6 +619,8 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
2413b1
                     ca_hostname = cs.getString("securitydomain.host", "");
2413b1
                     ca_port = cs.getInteger("securitydomain.httpseeport");
2413b1
                 }
2413b1
+
2413b1
+                CMS.debug("Calculated admin cert profile: " + data.getAdminProfileID());
2413b1
                 String b64 = ConfigurationUtils.submitAdminCertRequest(ca_hostname, ca_port,
2413b1
                         data.getAdminProfileID(), data.getAdminCertRequestType(),
2413b1
                         data.getAdminCertRequest(), adminSubjectDN);
2413b1
@@ -859,7 +874,7 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
2413b1
             cs.putString("preop.securitydomain.select", "existing");
2413b1
             cs.putString("securitydomain.select", "existing");
2413b1
             cs.putString("preop.cert.subsystem.type", "remote");
2413b1
-            cs.putString("preop.cert.subsystem.profile", "caInternalAuthSubsystemCert");
2413b1
+            cs.putString("preop.cert.subsystem.profile", data.getSystemCertProfileID("subsystem", "caInternalAuthSubsystemCert"));
2413b1
             String securityDomainURL = data.getSecurityDomainUri();
2413b1
             domainXML = logIntoSecurityDomain(data, securityDomainURL);
2413b1
         }
2413b1
-- 
2413b1
1.8.3.1
2413b1