summaryrefslogtreecommitdiffstats
path: root/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
diff options
context:
space:
mode:
authorChristina Fu <cfu@redhat.com>2016-06-16 15:44:58 -0700
committerChristina Fu <cfu@redhat.com>2016-06-16 18:28:02 -0700
commit51f34c3edb73a78b42468b756b89d07fc9ec7839 (patch)
treee3391419257b8e1d293477775bcbda151f1e660c /base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
parent1b80b8c38be4ad4edf7b8e9d817877225517ca83 (diff)
downloadpki-51f34c3edb73a78b42468b756b89d07fc9ec7839.tar.gz
pki-51f34c3edb73a78b42468b756b89d07fc9ec7839.tar.xz
pki-51f34c3edb73a78b42468b756b89d07fc9ec7839.zip
Ticket #2298 exclude some ldap record attributes with key archival This is part 2 of: https://fedorahosted.org/pki/ticket/2298 [non-TMS] for key archival/recovery, not to record certain data in ldap and logs
This patch allows one to exclude certain ldap attributes from the enrollment records for crmf requests (both CRMF, and CMC CRMF). The following are the highlights: * CRMF Manual approval profile is disabled: caDualCert.cfg - If excludedLdapAttrs.enabled is true, then this profile will not work, as the crmf requests (by default it is false) are not written to ldap record for agents to act on * excludedLdapAttrs.attrs can be used to configure the attribute list to be excluded * a new CRMF "auto approval" (directory based, needs to be setup) is provided * if excludedLdapAttrs.enabled is true (in both ca and kra), the following fields are not written to the ldap record in case of CRMF: (note: the code deliberately use literal strings on purpose for the reason that the exact literal strings need to be spelled out in excludedLdapAttrs.attrs if the admin chooses to override the default) "req_x509info", "publickey", "req_extensions", "cert_request", "req_archive_options", "req_key" * Because of the above (possible exclusion of cert requests in record, profiles that require agent manual approval will no longer function in the case that excludedLdapAttrs.enabled is true * a sleepOneMinute() method is added for debugging purpose. It is not called in the final code, but is left there for future debugging purpose * code was fixed so that in KRA request will display subject name even though the x509info is missing from request * cmc requests did not have request type in records, so they had to be added for differentiation The following have been tested: * CRMF auto enroll * CRMF manual enroll/approval * CMC-CRMF enroll * both CA and KRA internal ldap are examined for correct data exclusion Note: CRMF could potentially not include key archival option, however, I am not going to differentiate them at the moment. An earlier prototype I had built attempted to do that and the signing cert's record isn't excluded for attrs write while it's CRMF request is the same as that of its encryption cert counterpart within the same request. Due to this factor (multiple cert reqs with the same request blob), I am treating them the same for exclusion.
Diffstat (limited to 'base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java')
-rw-r--r--base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java b/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
index f2bf40241..67938af5d 100644
--- a/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
+++ b/base/server/cms/src/com/netscape/cms/authentication/CMCAuth.java
@@ -489,6 +489,8 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo,
if (type.equals(TaggedRequest.PKCS10)) {
CMS.debug("CMCAuth: type is PKCS10");
+ authToken.set("cert_request_type", "cmc-pkcs10");
+
TaggedCertificationRequest tcr =
taggedRequest.getTcr();
int p10Id = tcr.getBodyPartID().intValue();
@@ -581,6 +583,7 @@ public class CMCAuth implements IAuthManager, IExtendedPluginInfo,
} else if (type.equals(TaggedRequest.CRMF)) {
CMS.debug("CMCAuth: type is CRMF");
+ authToken.set("cert_request_type", "cmc-crmf");
try {
CertReqMsg crm =
taggedRequest.getCrm();