When installing a standalone KRA the admin certificate is base-64
encoded and stored in the kra.admin.cert property in the CS.cfg.
Previously the encoded certificate contains EOL characters which
may cause uninstall to fail due to parsing error. The install code
has been fixed to normalize the encoded certificate properly.

Pushed to master under one-liner/trivial rule.

--
Endi S. Dewata
>From 6b857d96515d4c2e0db3c44affe804c5d8aa7b44 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <[email protected]>
Date: Fri, 29 Apr 2016 05:32:09 +0200
Subject: [PATCH] Fixed problem uninstalling standalone KRA.

When installing a standalone KRA the admin certificate is base-64
encoded and stored in the kra.admin.cert property in the CS.cfg.
Previously the encoded certificate contains EOL characters which
may cause uninstall to fail due to parsing error. The install code
has been fixed to normalize the encoded certificate properly.
---
 base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
index a96575d0675018d489c8788c4afbb510cbefbe09..f9415f520eb264fece8846339ed9da2904c7dbfa 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
@@ -618,6 +618,7 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
 
                 if (data.getImportAdminCert().equalsIgnoreCase("true")) {
                     String b64 = CryptoUtil.stripCertBrackets(data.getAdminCert().trim());
+                    b64 = CryptoUtil.normalizeCertStr(b64);
                     if (data.getStandAlone() && data.getStepTwo()) {
                         // Stand-alone PKI (Step 2)
                         CMS.debug("SystemConfigService:  Stand-alone " + csType + " Admin Cert");
-- 
2.5.5

_______________________________________________
Pki-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/pki-devel

Reply via email to