[Pkg-freeipa-devel] [Git][freeipa-team/dogtag-pki][master] 10 commits: Disabled AIA and cert policy extensions in ACME examples

Timo Aaltonen gitlab at salsa.debian.org
Mon Aug 24 18:08:32 BST 2020



Timo Aaltonen pushed to branch master at FreeIPA packaging / dogtag-pki


Commits:
a5d1c9da by Endi S. Dewata at 2020-08-12T11:18:35-05:00
Disabled AIA and cert policy extensions in ACME examples

The ACME NSS issuer has been modified to disable the AIA and
certificate policy extensions by default since they contain
non-functional URLs that might cause certbot to generate
error messages.

https://bugzilla.redhat.com/show_bug.cgi?id=1868233

- - - - -
a48e731d by Alexander Scheel at 2020-08-12T11:33:32-05:00
Start NSSCertExportCLI

Can be tested with pki nss-cert-export

Signed-off-by: Alexander Scheel <ascheel at redhat.com>

- - - - -
0c6b6e91 by Alexander Scheel at 2020-08-12T11:33:32-05:00
Fix export on FIPS-enabled HSMs

Signed-off-by: Alexander Scheel <ascheel at redhat.com>

- - - - -
2df13c41 by Endi S. Dewata at 2020-08-12T11:33:33-05:00
Fixed cert nickname in NSSDatabase.export_cert_from_db()

The NSSDatabase.export_cert_from_db() has been modified to
no longer prepend the token name to the cert nickname since
the cert nickname obtained from serverCertNick.conf already
contains the token name.
- - - - -
eb28b09f by Endi S. Dewata at 2020-08-12T11:33:33-05:00
Removed blank lines in pki nss-cert-export output

The pki nss-cert-export has been modified to remove the extra
blank lines between certs and at the end of the output.
- - - - -
aeb5d041 by Christina Fu at 2020-08-18T09:31:14-07:00
Bug1629025-DEV doc for: Server-Side Keygen for EE

This patch provides document: ServerSideKeygen.adoc

https://bugzilla.redhat.com/show_bug.cgi?id=1629025

- - - - -
a6bf086a by Endi S. Dewata at 2020-08-18T16:54:40-05:00
Updated version number to 10.9.2

- - - - -
9c45f58c by Timo Aaltonen at 2020-08-20T16:56:37+03:00
Merge branch 'upstream'

- - - - -
9110d19b by Timo Aaltonen at 2020-08-20T16:57:07+03:00
bump the version

- - - - -
f8a2e8c6 by Timo Aaltonen at 2020-08-24T20:08:13+03:00
control, add-more-deps.diff: Add jaxb-impl and javax.activation to server dependencies due to jdk11.

- - - - -


15 changed files:

- base/acme/issuer/nss/ca_signing.conf
- base/acme/issuer/nss/sslserver.conf
- base/common/python/pki/nssdb.py
- base/java-tools/src/com/netscape/cmstools/nss/NSSCertCLI.java
- + base/java-tools/src/com/netscape/cmstools/nss/NSSCertExportCLI.java
- debian/changelog
- debian/control
- + debian/patches/add-more-deps.diff
- debian/patches/series
- docs/admin/CertificateTransparency.adoc
- + docs/admin/ServerSideKeygen.adoc
- + docs/admin/images/Server-SideKeygenEnroll_approval.png
- + docs/admin/images/Server-SideKeygenEnroll_manual.png
- + docs/admin/images/Server-SideKeygen_LDAP_auth.png
- pki.spec


Changes:

=====================================
base/acme/issuer/nss/ca_signing.conf
=====================================
@@ -1,8 +1,9 @@
 basicConstraints       = critical, CA:TRUE
 subjectKeyIdentifier   = hash
-authorityInfoAccess    = OCSP;URI:http://ocsp.example.com, caIssuers;URI:http://cert.example.com
 keyUsage               = critical, digitalSignature, keyCertSign, cRLSign
-certificatePolicies    = 2.23.140.1.2.1, @cps_policy
 
-cps_policy.id          = 1.3.6.1.4.1.44947.1.1.1
-cps_policy.CPS.1       = http://cps.example.com
+# authorityInfoAccess    = OCSP;URI:http://ocsp.example.com, caIssuers;URI:http://cert.example.com
+
+# certificatePolicies    = 2.23.140.1.2.1, @cps_policy
+# cps_policy.id          = 1.3.6.1.4.1.44947.1.1.1
+# cps_policy.CPS.1       = http://cps.example.com


=====================================
base/acme/issuer/nss/sslserver.conf
=====================================
@@ -1,10 +1,11 @@
 basicConstraints       = critical, CA:FALSE
 subjectKeyIdentifier   = hash
 authorityKeyIdentifier = keyid:always
-authorityInfoAccess    = OCSP;URI:http://ocsp.example.com, caIssuers;URI:http://cert.example.com
 keyUsage               = critical, digitalSignature, keyEncipherment
 extendedKeyUsage       = serverAuth, clientAuth
-certificatePolicies    = 2.23.140.1.2.1, @cps_policy
 
-cps_policy.id          = 1.3.6.1.4.1.44947.1.1.1
-cps_policy.CPS.1       = http://cps.example.com
+# authorityInfoAccess    = OCSP;URI:http://ocsp.example.com, caIssuers;URI:http://cert.example.com
+
+# certificatePolicies    = 2.23.140.1.2.1, @cps_policy
+# cps_policy.id          = 1.3.6.1.4.1.44947.1.1.1
+# cps_policy.CPS.1       = http://cps.example.com


=====================================
base/common/python/pki/nssdb.py
=====================================
@@ -1351,6 +1351,35 @@ class NSSDatabase(object):
         epoch = datetime.datetime.utcfromtimestamp(0)
         return (date - epoch).total_seconds() * 1000
 
+    def export_cert_from_db(self,
+                            nickname,
+                            output_file,
+                            include_chain=False,
+                            output_format=None):
+        cmd = [
+            'pki',
+            '-d', self.directory
+        ]
+
+        if self.password_file:
+            cmd.extend(['-C', self.password_file])
+
+        if self.token:
+            cmd.extend(['--token', self.token])
+
+        cmd.extend(['nss-cert-export'])
+
+        if include_chain:
+            cmd.extend(['--with-chain'])
+
+        if output_format:
+            cmd.extend(['--format', output_format])
+
+        cmd.extend([nickname, output_file])
+
+        logger.debug('Command: %s', ' '.join(map(str, cmd)))
+        subprocess.check_call(cmd)
+
     def export_cert(self,
                     nickname,
                     pkcs12_file,
@@ -1752,39 +1781,11 @@ class NSSDatabase(object):
             shutil.rmtree(tmpdir)
 
     def extract_ca_cert(self, ca_path, nickname):
-        tmpdir = tempfile.mkdtemp()
-
-        try:
-            p12_file = os.path.join(tmpdir, "sslserver.p12")
-            password = pki.generate_password()
-
-            # Build a chain containing the certificate we're trying to
-            # export. OpenSSL gets confused if we don't have a key for
-            # the end certificate: rh-bz#1246371
-            self.export_pkcs12(p12_file, pkcs12_password=password,
-                               nicknames=[nickname], include_key=False,
-                               include_chain=True)
-
-            # This command is similar to the one from server/__init__.py..
-            # However, to work during the initial startup, we do not
-            # specify the cacerts option! This ensures we always get
-            cmd_export_ca = [
-                'openssl', 'pkcs12',
-                '-in', p12_file,
-                '-out', ca_path,
-                '-nodes', '-nokeys',
-                '-passin', 'pass:' + password
-            ]
-
-            # Remove CA.crt prior to starting; openssl gets annoyed otherwise.
-            if os.path.exists(ca_path):
-                os.remove(ca_path)
-
-            res_ca = subprocess.check_output(cmd_export_ca,
-                                             stderr=subprocess.STDOUT).decode('utf-8')
-            logger.debug('Result of CA cert export: %s', res_ca)
-        finally:
-            shutil.rmtree(tmpdir)
+        # Build a chain containing the certificate we're trying to
+        # export. OpenSSL gets confused if we don't have a key for
+        # the end certificate: rh-bz#1246371
+        self.export_cert_from_db(nickname, ca_path, include_chain=True,
+                                 output_format="PEM")
 
     @staticmethod
     def __generate_key_args(key_type=None, key_size=None, curve=None):


=====================================
base/java-tools/src/com/netscape/cmstools/nss/NSSCertCLI.java
=====================================
@@ -12,8 +12,9 @@ public class NSSCertCLI extends CLI {
     public NSSCertCLI(NSSCLI nssCLI) {
         super("cert", "NSS certificate management commands", nssCLI);
 
+        addModule(new NSSCertExportCLI(this));
         addModule(new NSSCertImportCLI(this));
-        addModule(new NSSCertRequestCLI(this));
         addModule(new NSSCertIssueCLI(this));
+        addModule(new NSSCertRequestCLI(this));
     }
 }


=====================================
base/java-tools/src/com/netscape/cmstools/nss/NSSCertExportCLI.java
=====================================
@@ -0,0 +1,129 @@
+//
+// Copyright Red Hat, Inc.
+//
+// SPDX-License-Identifier: GPL-2.0-or-later
+//
+package com.netscape.cmstools.nss;
+
+import java.io.FileOutputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import javax.net.ssl.KeyManagerFactory;
+import java.security.cert.X509Certificate;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.io.IOUtils;
+import org.dogtagpki.cli.CommandCLI;
+import org.dogtagpki.nss.NSSDatabase;
+import org.mozilla.jss.pkcs11.PK11Cert;
+import org.mozilla.jss.netscape.security.util.Cert;
+import org.mozilla.jss.netscape.security.util.Utils;
+import org.mozilla.jss.netscape.security.x509.X509CertImpl;
+import org.mozilla.jss.provider.javax.crypto.JSSKeyManager;
+
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.cmstools.cli.MainCLI;
+
+public class NSSCertExportCLI extends CommandCLI {
+
+    public static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(NSSCertExportCLI.class);
+
+    public NSSCertExportCLI(NSSCertCLI nssCertCLI) {
+        super("export", "Export certificate", nssCertCLI);
+    }
+
+    public void printHelp() {
+        formatter.printHelp(getFullName() + " [OPTIONS...] nickname [path]", options);
+    }
+
+    public void createOptions() {
+        Option option = new Option(null, "format", true, "Certificate format: PEM (default), DER, RAW");
+        option.setArgName("format");
+        options.addOption(option);
+
+        option = new Option(null, "with-chain", false, "Export with certificate chain from NSS DB");
+        option.setArgName("with-chain");
+        options.addOption(option);
+    }
+
+    public void execute(CommandLine cmd) throws Exception {
+
+        String[] cmdArgs = cmd.getArgs();
+        String nickname = null;
+        String path = null;
+
+        if (cmdArgs.length < 1) {
+            throw new Exception("Missing required positional argument: nickname");
+        }
+        nickname = cmdArgs[0];
+
+        if (cmdArgs.length >= 2) {
+            path = cmdArgs[1];
+        }
+
+        String format = cmd.getOptionValue("format", "PEM").toUpperCase();
+        boolean chain = cmd.hasOption("with-chain");
+
+        if (!format.equals("PEM") && !format.equals("DER") && !format.equals("RAW")) {
+            throw new Exception("Unknown type of output format: " + format);
+        }
+
+        if (chain && format.equals("DER")) {
+            throw new Exception("Unable to write chain of DER-encoded certificates; use PEM instead.");
+        }
+
+        MainCLI mainCLI = (MainCLI) getRoot();
+        mainCLI.init();
+
+        X509Certificate[] certs;
+
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance("NssX509", "Mozilla-JSS");
+        JSSKeyManager km = (JSSKeyManager) kmf.getKeyManagers()[0];
+
+        if (chain) {
+            certs = km.getCertificateChain(nickname);
+        } else {
+            certs = new X509Certificate[] {
+                (PK11Cert) km.getCertificate(nickname)
+            };
+        }
+
+        byte[] output = null;
+
+        if (format.equals("RAW")) {
+            StringBuffer buffer = new StringBuffer();
+            for (X509Certificate cert : certs) {
+                buffer.append(cert.toString());
+            }
+
+            output = buffer.toString().getBytes();
+        } else if (format.equals("PEM")) {
+            StringBuffer buffer = new StringBuffer();
+
+            for (X509Certificate cert : certs) {
+                byte[] encoded = cert.getEncoded();
+                buffer.append(Cert.HEADER);
+                buffer.append("\r\n");
+                buffer.append(Utils.base64encodeMultiLine(encoded));
+                buffer.append(Cert.FOOTER);
+                buffer.append("\r\n");
+            }
+
+            output = buffer.toString().getBytes();
+        } else if (format.equals("DER")) {
+            for (X509Certificate cert : certs) {
+                output = cert.getEncoded();
+            }
+        }
+
+        if (path == null) {
+            System.out.print(new String(output));
+            System.out.flush();
+        } else {
+            try (FileOutputStream fos = new FileOutputStream(path)) {
+                fos.write(output);
+            }
+        }
+    }
+}


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+dogtag-pki (10.9.2-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+  * control, add-more-deps.diff: Add jaxb-impl and javax.activation to server
+    dependencies due to jdk11.
+
+ -- Timo Aaltonen <tjaalton at debian.org>  Thu, 20 Aug 2020 16:56:54 +0300
+
 dogtag-pki (10.9.1-2) unstable; urgency=medium
 
   * pki-base.postinst: Drop --silent. (Closes: #963048)


=====================================
debian/control
=====================================
@@ -12,6 +12,7 @@ Build-Depends:
  go-md2man,
  javahelper,
  junit4,
+ libactivation-java,
  libcommons-cli-java,
  libcommons-codec-java,
  libcommons-httpclient-java,
@@ -24,6 +25,7 @@ Build-Depends:
  libjackson2-annotations-java,
  libjackson2-core-java,
  libjackson2-databind-java,
+ libjaxb-java,
  libjss-java (>= 4.7.0~),
  libldap-java (>= 4.21.0+dfsg1),
  libldap2-dev,
@@ -175,6 +177,7 @@ Depends:
  dogtag-pki-server-theme (>= ${source:Version}),
  keyutils,
  ldap-utils,
+ libactivation-java,
  libatk-wrapper-java,
  libcommons-collections3-java,
  libcommons-dbcp-java,
@@ -183,6 +186,7 @@ Depends:
  libjackson-json-java,
  libjackson2-annotations-java,
  libjackson2-jaxrs-providers-java,
+ libjaxb-java,
  libjboss-logging-java,
  libjs-jquery,
  libjs-underscore,


=====================================
debian/patches/add-more-deps.diff
=====================================
@@ -0,0 +1,178 @@
+--- a/.classpath
++++ b/.classpath
+@@ -34,6 +34,8 @@
+ 	<classpathentry kind="lib" path="/usr/share/java/junit.jar"/>
+ 	<classpathentry kind="lib" path="/usr/share/java/ldapjdk.jar"/>
+ 	<classpathentry kind="lib" path="/usr/share/java/jaxb-api.jar"/>
++	<classpathentry kind="lib" path="/usr/share/java/jaxb/jaxb-impl.jar"/>
++	<classpathentry kind="lib" path="/usr/share/java/jakarta-activation/jakarta.activation.jar"/>
+ 	<classpathentry kind="lib" path="/usr/share/java/httpcomponents/httpclient.jar"/>
+ 	<classpathentry kind="lib" path="/usr/share/java/httpcomponents/httpcore.jar"/>
+ 	<classpathentry kind="lib" path="/usr/share/java/jboss-jaxrs-2.0-api.jar"/>
+--- a/base/CMakeLists.txt
++++ b/base/CMakeLists.txt
+@@ -176,6 +176,29 @@ find_file(JAXB_API_JAR
+         /usr/share/java
+ )
+ 
++find_file(JAXB_IMPL_JAR
++    NAMES
++        jaxb-impl.jar
++    PATHS
++        /usr/share/java/jaxb
++        /usr/share/java
++)
++
++find_file(JAKARTA_ACTIVATION_JAR
++    NAMES
++        jakarta.activation.jar
++        jakarta-activation.jar
++        jaxb.activation.jar
++        jaxb-activation.jar
++        javax.activation.jar
++    PATHS
++        /usr/share/java/jakarta-activation
++        /usr/share/java/jakarta
++        /usr/share/java/jaxb-activation
++        /usr/share/java/jaxb
++        /usr/share/java
++)
++
+ find_file(JSS_JAR
+     NAMES
+         jss4.jar
+--- a/base/common/CMakeLists.txt
++++ b/base/common/CMakeLists.txt
+@@ -29,6 +29,8 @@ add_custom_command(
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JACKSON2_JAXRS_JSON_PROVIDER_JAR} lib/jackson-jaxrs-json-provider.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JACKSON2_JAXB_ANNOTATIONS_JAR} lib/jackson-module-jaxb-annotations.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JAXB_API_JAR} lib/jaxb-api.jar
++    COMMAND ${CMAKE_COMMAND} -E create_symlink ${JAXB_IMPL_JAR} lib/jaxb-impl.jar
++    COMMAND ${CMAKE_COMMAND} -E create_symlink ${JAKARTA_ACTIVATION_JAR} lib/jakarta.activation.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JSS_JAR} lib/jss4.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${LDAPJDK_JAR} lib/ldapjdk.jar
+     COMMAND ln -sf /usr/share/java/pki/pki-certsrv.jar ${CMAKE_CURRENT_BINARY_DIR}/lib/pki-certsrv.jar
+@@ -147,7 +149,7 @@ install(
+ 
+ install(
+     DIRECTORY
+-    DESTINATION 
++    DESTINATION
+         ${SYSTEMD_ETC_INSTALL_DIR}/pki-tomcatd.target.wants
+ )
+ 
+--- a/base/server/CMakeLists.txt
++++ b/base/server/CMakeLists.txt
+@@ -97,6 +97,9 @@ add_custom_command(
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JACKSON2_JAXRS_BASE_JAR} common/lib/jackson-jaxrs-base.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JACKSON2_JAXRS_JSON_PROVIDER_JAR} common/lib/jackson-jaxrs-json-provider.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JACKSON2_JAXB_ANNOTATIONS_JAR} common/lib/jackson-module-jaxb-annotations.jar
++    COMMAND ${CMAKE_COMMAND} -E create_symlink ${JAXB_API_JAR} common/lib/jaxb-api.jar
++    COMMAND ${CMAKE_COMMAND} -E create_symlink ${JAXB_IMPL_JAR} common/lib/jaxb-impl.jar
++    COMMAND ${CMAKE_COMMAND} -E create_symlink ${JAKARTA_ACTIVATION_JAR} common/lib/jakarta.activation.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${JSS_JAR} common/lib/jss4.jar
+     COMMAND ${CMAKE_COMMAND} -E create_symlink ${LDAPJDK_JAR} common/lib/ldapjdk.jar
+     COMMAND ln -sf /usr/share/java/pki/pki-cmsutil.jar ${CMAKE_CURRENT_BINARY_DIR}/common/lib/pki-cmsutil.jar
+--- a/base/server/python/pki/server/deployment/scriptlets/security_databases.py
++++ b/base/server/python/pki/server/deployment/scriptlets/security_databases.py
+@@ -198,10 +198,11 @@ class PkiScriptlet(pkiscriptlet.Abstract
+             # Export CA certificate to PEM file; same command as in
+             # PKIServer.setup_cert_authentication().
+             # openssl pkcs12 -in <p12_file_path> -out /tmp/auth.pem -nodes -nokeys
++            pki_ca_crt_path = os.path.join(pki_server_database_path, 'ca.crt')
+             cmd_export_ca = [
+                 'openssl', 'pkcs12',
+                 '-in', pki_clone_pkcs12_path,
+-                '-out', os.path.join(pki_server_database_path, 'ca.crt'),
++                '-out', pki_ca_crt_path,
+                 '-nodes',
+                 '-nokeys',
+                 '-passin', 'pass:' + pki_clone_pkcs12_password
+@@ -210,6 +211,14 @@ class PkiScriptlet(pkiscriptlet.Abstract
+                                              stderr=subprocess.STDOUT).decode('utf-8')
+             logger.debug('Result of CA certificate export: %s', res_ca)
+ 
++            # At this point, we're running as root. However, the subsystem
++            # will eventually start up as non-root and will attempt to do a
++            # migration. If we don't fix the permissions now, migration will
++            # fail and subsystem won't start up.
++            pki.util.chmod(pki_ca_crt_path, 0o644)
++            pki.util.chown(pki_ca_crt_path, deployer.mdict['pki_uid'],
++                           deployer.mdict['pki_gid'])
++
+         ca_cert_path = deployer.mdict.get('pki_cert_chain_path')
+         if ca_cert_path and os.path.exists(ca_cert_path):
+             destination = os.path.join(instance.nssdb_dir, "ca.crt")
+--- a/base/server/share/conf/pki.policy
++++ b/base/server/share/conf/pki.policy
+@@ -48,6 +48,14 @@ grant codeBase "file:/usr/share/java/jax
+         permission java.security.AllPermission;
+ };
+ 
++grant codeBase "file:/usr/share/java/jaxb/jaxb-impl.jar" {
++        permission java.security.AllPermission;
++};
++
++grant codeBase "file:/usr/share/java/jakarta-activation/jakarta.activation.jar" {
++        permission java.security.AllPermission;
++};
++
+ grant codeBase "file:/usr/share/java/jaxme/jaxmeapi.jar" {
+         permission java.security.AllPermission;
+ };
+--- a/pki.spec
++++ b/pki.spec
+@@ -418,6 +418,11 @@ Requires:         resteasy-core >= 3.0.1
+ Requires:         resteasy-jackson2-provider >= 3.0.17-1
+ %endif
+ 
++%if 0%{?fedora} && 0%{?fedora} >= 33
++Requires:         jaxb-impl >= 2.3.3
++Requires:         jakarta-activation >= 1.2.2
++%endif
++
+ Requires:         xalan-j2
+ Requires:         xerces-j2
+ Requires:         xml-commons-apis
+--- a/pom.xml
++++ b/pom.xml
+@@ -81,6 +81,18 @@
+         </dependency>
+ 
+         <dependency>
++            <groupId>com.sun.xml.bind</groupId>
++            <artifactId>jaxb-impl</artifactId>
++            <version>2.3.3</version>
++        </dependency>
++
++        <dependency>
++            <groupId>jakarta.activation</groupId>
++            <artifactId>jakarta.activation-api</artifactId>
++            <version>1.2.2</version>
++        </dependency>
++
++        <dependency>
+             <groupId>org.jboss.spec.javax.annotation</groupId>
+             <artifactId>jboss-annotations-api_1.2_spec</artifactId>
+             <version>1.0.0.Final</version>
+--- a/scripts/compose_pki_test_package
++++ b/scripts/compose_pki_test_package
+@@ -118,6 +118,8 @@ CLASSPATH=$CLASSPATH:/usr/share/java/idm
+ CLASSPATH=$CLASSPATH:/usr/share/java/idm-console-nmclf.jar
+ CLASSPATH=$CLASSPATH:/usr/share/java/jakarta-commons-httpclient.jar
+ CLASSPATH=$CLASSPATH:/usr/share/java/jaxb-api.jar
++CLASSPATH=$CLASSPATH:/usr/share/java/jaxb/jaxb-impl.jar
++CLASSPATH=$CLASSPATH:/usr/share/java/jakarta-activation/jakarta.activation.jar
+ CLASSPATH=$CLASSPATH:/usr/share/java/ldapjdk.jar
+ CLASSPATH=$CLASSPATH:/usr/share/java/apache-commons-lang.jar
+ CLASSPATH=$CLASSPATH:/usr/share/java/istack-commons-runtime.jar
+--- a/tests/dogtag/dev_java_tests/run_junit_tests.sh
++++ b/tests/dogtag/dev_java_tests/run_junit_tests.sh
+@@ -54,6 +54,7 @@ run_dev_junit_tests() {
+     CLASSPATH=$CLASSPATH:/usr/share/java/idm-console-nmclf.jar
+     CLASSPATH=$CLASSPATH:/usr/share/java/jakarta-commons-httpclient.jar
+     CLASSPATH=$CLASSPATH:/usr/share/java/jaxb-api.jar
++    CLASSPATH=$CLASSPATH:/usr/share/java/jakarta-activation/jakarta.activation.jar
+     CLASSPATH=$CLASSPATH:/usr/share/java/ldapjdk.jar
+     CLASSPATH=$CLASSPATH:/usr/share/java/apache-commons-lang.jar
+     CLASSPATH=$CLASSPATH:/usr/share/java/istack-commons-runtime.jar


=====================================
debian/patches/series
=====================================
@@ -16,3 +16,4 @@ fix-tomcat-jars.diff
 fix-hamcrest-jar.diff
 fix-healthcheck-install.diff
 revert-support-jdk8-jdk11-rpm-builds.diff
+add-more-deps.diff


=====================================
docs/admin/CertificateTransparency.adoc
=====================================
@@ -1,8 +1,10 @@
 = Certificate Transparency
+Christina Fu <cfu at redhat.com>
+:toc:
 
 == Overview
 
-A basic version of Certificate Transparency (CT) V1 support (rfc 6962) is offered in this release. It has the capability of issuing certificates with embedded Signed Certificate Time stamps (SCTs) from any trusted log where each deployment site chooses to have its root CA cert included. The system can also be configured to support multiple CT logs.  Minimum of one trusted CT log is required for this feature to work.
+A basic version of Certificate Transparency (CT) V1 support (rfc 6962) is offered since PKI 10.9. It has the capability of issuing certificates with embedded Signed Certificate Time stamps (SCTs) from any trusted log where each deployment site chooses to have its root CA cert included. The system can also be configured to support multiple CT logs.  Minimum of one trusted CT log is required for this feature to work.
 
 IMPORTANT: It is the responsibility of the deployment site to establish its trust relationship with a trusted CT log server.
 


=====================================
docs/admin/ServerSideKeygen.adoc
=====================================
@@ -0,0 +1,177 @@
+= ServerSide Key Generation for EE
+Christina Fu <cfu at redhat.com>
+:toc:
+:imagesdir: images
+
+== Overview
+
+Many newer versions of browsers, including Firefox v69 and up, as well as Chrome, have removed the functionality to generate PKI keys and the support for CRMF for key archival. While CLIs such as CRMFPopClient (see "CRMFPopClient --help") or pki (see "pki client-cert-request --help") could be used as a workaround on the Fedora or RHEL platforms, clients on other platforms have been largely left out.
+
+Server-Side Keygen enrollment has been around for a long time since the introduction of Token Key Management System (TMS), where keys could be generated on KRA instead of locally on smart cards. Starting from PKI v.10.5, we adopt a similar mechanism to resolve the browser keygen deficiency issue.   Keys are generated on the server (KRA to be specific) and then transferred securely back to the client in PKCS#12.
+
+NOTE: It is highly recommended that the Server-Side Keygen mechanism only being employed for encryption certificates.
+
+== Functionality Highlights
+
+* Certificate request keys are generated on KRA (Note: KRA must be installed to work with the CA)
+* The profile default plugin, serverKeygenUserKeyDefaultImpl, provides selection to enable or disable key archival (i.e. the “enableArchival” parameter)
+* Support for both RSA and EC keys
+* Support for both manual (agent) approval and automatic approval (e.g. directory password-based)
+
+== Installation configuration
+
+NOTE: A KRA instance is required in addition to the CA for setting up Server-Side Keygen.
+
+NOTE: In the case when the CA and KRA are sharing a Tomcat instance, there is no need to execute the above step to import the transport certificate.
+
+After installing CA and KRA instances, in the case of stand-alone Tomcat web server instances, you’d need to add the KRA’s transport cert to the CA’s nssdb.
+
+First, shut down CA
+
+[literal]
+Systemctl stop pki-tomcatd@<ca_instance_name>.service
+e.g.
+# Systemctl stop pki-tomcatd at pki-ca.service
+
+Export KRA’s transport certificate into a file
+
+* Find and export KRA transport cert:
+
+[literal]
+grep "kra.transport.cert=" /var/lib/pki/<kra_instance_name>/kra/conf/CS.cfg | sed 's/kra.transport.cert=//' > <kra transport cert file>
+e.g.
+# grep "kra.transport.cert=" /var/lib/pki/pki-kra/kra/conf/CS.cfg | sed 's/kra.transport.cert=//' > /tmp/kraTransport.cert
+
+Import KRA’s transport cert into CA’s nssdb, using the nickname specified in CA’s CS.cfg
+
+* List the transport cert nickname:
+
+[literal]
+grep "ca.connector.KRA.transportCertNickname" /var/lib/pki/<ca_instance_name>/ca/conf/CS.cfg
+e.g.
+# grep "ca.connector.KRA.transportCertNickname" /var/lib/pki/pki-ca/ca/conf/CS.cfg
+ca.connector.KRA.transportCertNickname=KRA transport cert
+
+* Import using the nickname listed from above step:
+
+[literal]
+certutil -d /var/lib/pki/<ca_instance_name>/alias -A -t “,,” -n <transportNickName> -i <kra transport cert file>
+e.g.
+# certutil -d /var/lib/pki/pki-ca/alias -A -t “,,” -n "KRA transport cert" -i /tmp/kraTransport.cert
+
+Start CA
+
+[literal]
+systemctl start pki-tomcatd@<ca_instance_name>.service
+e.g.
+# Systemctl start pki-tomcatd at pki-ca.service
+
+== Profile Configuration
+
+Two default profiles, *_caServerKeygen_UserCert_* and *_caServerKeygen_DirUserCert_*, are provided by default to allow for certificate enrollments where keys are generated on the server side. However, any profile with the right input, output, and policy set could be turned into a server-side keygen profile.
+
+A Server-Side Keygen profile must contain the following components.
+
+=== Input
+
+[literal]
+input.i1.class_id=serverKeygenInputImpl
+
+=== Output
+
+[literal]
+output.o1.class_id=pkcs12OutputImpl
+
+=== Policyset
+
+Key type and key size parameters can be configured as exemplified below:
+
+[literal]
+policyset.userCertSet.3.constraint.class_id=keyConstraintImpl
+policyset.userCertSet.3.constraint.name=Key Constraint
+policyset.userCertSet.3.constraint.params.keyType=-
+policyset.userCertSet.3.constraint.params.keyParameters=1024,2048,3072,4096,nistp256,nistp384,nistp521
+policyset.userCertSet.3.default.class_id=serverKeygenUserKeyDefaultImpl
+policyset.userCertSet.3.default.name=Server-Side Keygen Default
+policyset.userCertSet.3.default.params.keyType=RSA
+policyset.userCertSet.3.default.params.keySize=2048
+policyset.userCertSet.3.default.params.enableArchival=true
+
+=== Authentication
+
+The two default server-side keygen enrollment profiles different in the authentication mechanism, where
+
+caServerKeygen_UserCert.cfg ::
+        contains empty value to *"auth.class_id="*, meaning that enrollment requests through this profile will require approval from a CA agent..
+caServerKeygen_DirUserCert.cfg ::
+        contains *"auth.instance_id=UserDirEnrollment"*, meaning that the user is required to pass LDAP uid/password authentication; Such authentication mechanism is considered as an automatic certificate issuance as it does not require per-request approval from a CA agent.
+
+Automatic approval could be configured by setting the auth.instance_id directive to any compatible authentication plugin class, as examplified in the caServerKeygen_DirUserCert.cfg profile mentioned above. Here is an example of such configuration in CS.cfg:
+
+[literal]
+auths.instance.UserDirEnrollment.dnpattern=
+auths.instance.UserDirEnrollment.ldap.basedn=ou=People,dc=example,dc=com
+auths.instance.UserDirEnrollment.ldap.ldapconn.host=host.example.com
+auths.instance.UserDirEnrollment.ldap.ldapconn.port=389
+auths.instance.UserDirEnrollment.ldap.ldapconn.secureConn=false
+auths.instance.UserDirEnrollment.ldap.maxConns=
+auths.instance.UserDirEnrollment.ldap.minConns=
+auths.instance.UserDirEnrollment.ldapByteAttributes=
+auths.instance.UserDirEnrollment.ldapStringAttributes=mail
+auths.instance.UserDirEnrollment.pluginName=UidPwdDirAuth
+
+== Enrolling a Certificate Using Server-Side Keygen
+
+The default Sever-Side Keygen enrollment profile can be found on the EE page, under the “List Certificate Profiles” tab:
+
+=== Manual User Dual-Use Certificate Enrollment Using server-side Key generation
+
+.Server-Side Keygen Enrollment that requires agent manual approval
+image::Server-SideKeygenEnroll_manual.png[]
+
+=== Directory-authenticated User Dual-Use Certificate Enrollment Using server-side Key generation
+
+.Server-Side Keygen Enrollment that will be automatically approved upon successful LDAP uid/pwd authentication
+image::Server-SideKeygen_LDAP_auth.png[]
+
+Regardless of how the request is approved, the Server-Side Keygen Enrollment mechanism requires the End Entity user to enter a password for the PKCS#12 package which will contain the issued certificate as well as the encrypted private key generated by the server once issued.
+
+IMPORTANT: Users should not share their passwords with anyone. Not even the CA or KRA agents.
+
+When the enrollment request is approved, the PKCS#12 package will be generated and,
+
+* In case of manual approval, the PKCS#12 file will be returned to the CA agent that approves the request; The agent is then expected to forward the PKCS#12 file to the user.
+* In case of automatic approval, the PKCS#12 file will be returned to the user who submitted the request
+
+.Enrollment manually approved by an agent
+image::Server-SideKeygenEnroll_approval.png[]
+
+Once the PKCS#12 is received, the user could use cli such as pkcs12util to import the PKCS#12 file into her/her own user internal cert/key database for each application. E.g. the user’s Firefox nss database.
+
+== Key Recovery
+
+If the *_enableArchival_* parameter is set to *_true_* in the certificate enrollment profile, then the private keys are archived at the time of Server-Side Keygen enrollment.  The archived private keys could then be recovered by the authorized KRA agents.
+
+== Additional Information
+
+=== KRA Request Records
+
+NOTE: due to the nature of this mechanism, in case when *_enableArchival_* parameter is set to *_true_* in the profile, there are two KRA requests records per Server-Side keygen request:
+
+* One for request type “asymkeyGenRequest”
+** This request type cannot be filtered at “List Requests” on KRA agent page; One could select “Show All Requests” to see them listed.
+* One for request type “recovery”
+
+=== Audit Records
+
+Some audit records could be observed if enabled:
+
+CA
+
+* SERVER_SIDE_KEYGEN_ENROLL_KEYGEN_REQUEST
+* SERVER_SIDE_KEYGEN_ENROLL_KEY_RETRIEVAL_REQUEST
+
+KRA
+
+* SERVER_SIDE_KEYGEN_ENROLL_KEYGEN_REQUEST_PROCESSED
+* SERVER_SIDE_KEYGEN_ENROLL_KEY_RETRIEVAL_REQUEST_PROCESSED (not yet implemented)


=====================================
docs/admin/images/Server-SideKeygenEnroll_approval.png
=====================================
Binary files /dev/null and b/docs/admin/images/Server-SideKeygenEnroll_approval.png differ


=====================================
docs/admin/images/Server-SideKeygenEnroll_manual.png
=====================================
Binary files /dev/null and b/docs/admin/images/Server-SideKeygenEnroll_manual.png differ


=====================================
docs/admin/images/Server-SideKeygen_LDAP_auth.png
=====================================
Binary files /dev/null and b/docs/admin/images/Server-SideKeygen_LDAP_auth.png differ


=====================================
pki.spec
=====================================
@@ -12,7 +12,7 @@ License:          GPLv2 and LGPLv2
 
 # For development (unsupported) releases, use x.y.z-0.n.unstable with alpha/beta phase.
 # For official (supported) releases, use x.y.z-r where r >=1 without alpha/beta phase.
-Version:          10.9.1
+Version:          10.9.2
 Release:          1%{?_timestamp}%{?_commit_id}%{?dist}
 #global           _phase -a1
 



View it on GitLab: https://salsa.debian.org/freeipa-team/dogtag-pki/-/compare/5ad72b0d8c2bd5ed42aefb6269f05314189e7ea3...f8a2e8c63b8970d8d1381492850bb7e23bd9e9f9

-- 
View it on GitLab: https://salsa.debian.org/freeipa-team/dogtag-pki/-/compare/5ad72b0d8c2bd5ed42aefb6269f05314189e7ea3...f8a2e8c63b8970d8d1381492850bb7e23bd9e9f9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-freeipa-devel/attachments/20200824/f5aecf4f/attachment-0001.html>


More information about the Pkg-freeipa-devel mailing list