From 0b800b86153d55a28ed9b7afa24f3eca2df4396b Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Wed, 28 Oct 2015 18:49:47 +0530 Subject: [PATCH 1/4] Bug fixes --- .../pom.xml | 2 +- .../mgt/core/impl/CertificateGenerator.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index a253cc9a7f3..b4c1513c044 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -58,7 +58,7 @@ org.apache.commons.logging, javax.security.auth.x500, javax.xml.parsers, - org.apache.commons.codec.binary, + org.apache.commons.codec.binary;version="${version.commons.codec}", org.bouncycastle.asn1, org.bouncycastle.asn1.x500, org.bouncycastle.asn1.x509, diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java index c97d84472d1..a9c79553dba 100755 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java @@ -348,19 +348,19 @@ public class CertificateGenerator { Date validityBeginDate = commonUtil.getValidityStartDate(); Date validityEndDate = commonUtil.getValidityEndDate(); - X500Name certSubject = request.getSubject(); + X500Name certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); Attribute attributes[] = request.getAttributes(); - if (certSubject == null) { - certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); - } else { - org.bouncycastle.asn1.x500.RDN[] rdn = certSubject.getRDNs(); - - if (rdn == null || rdn.length == 0) { - certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); - } - } - +// if (certSubject == null) { +// certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); +// } else { +// org.bouncycastle.asn1.x500.RDN[] rdn = certSubject.getRDNs(); +// +// if (rdn == null || rdn.length == 0) { +// certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); +// } +// } + X509v3CertificateBuilder certificateBuilder = new X509v3CertificateBuilder( new X500Name(issueSubject), CommonUtil.generateSerialNumber(), validityBeginDate, validityEndDate, certSubject, request.getSubjectPublicKeyInfo()); From bbc11321001283325dc82e99c29c666d41cf0cb6 Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Wed, 28 Oct 2015 19:24:05 +0530 Subject: [PATCH 2/4] Commenting previous lines --- .../certificate/mgt/core/impl/CertificateGenerator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java index a9c79553dba..7735922f51c 100755 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java @@ -349,6 +349,8 @@ public class CertificateGenerator { Date validityEndDate = commonUtil.getValidityEndDate(); X500Name certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); + //X500Name certSubject = request.getSubject(); + Attribute attributes[] = request.getAttributes(); // if (certSubject == null) { @@ -360,7 +362,7 @@ public class CertificateGenerator { // certSubject = new X500Name(ConfigurationUtil.DEFAULT_PRINCIPAL); // } // } - + X509v3CertificateBuilder certificateBuilder = new X509v3CertificateBuilder( new X500Name(issueSubject), CommonUtil.generateSerialNumber(), validityBeginDate, validityEndDate, certSubject, request.getSubjectPublicKeyInfo()); From 5c2b7c9624e6a0c72f3f3edf4b72e460eaa5b310 Mon Sep 17 00:00:00 2001 From: Dilshan Edirisuriya Date: Wed, 28 Oct 2015 20:06:10 +0530 Subject: [PATCH 3/4] Removing commons codec version --- .../org.wso2.carbon.certificate.mgt.core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index b4c1513c044..a253cc9a7f3 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -58,7 +58,7 @@ org.apache.commons.logging, javax.security.auth.x500, javax.xml.parsers, - org.apache.commons.codec.binary;version="${version.commons.codec}", + org.apache.commons.codec.binary, org.bouncycastle.asn1, org.bouncycastle.asn1.x500, org.bouncycastle.asn1.x509, From 79cc441c7166f1053c21440e1b864475d6d46d9f Mon Sep 17 00:00:00 2001 From: prabathabey Date: Wed, 28 Oct 2015 20:42:43 +0530 Subject: [PATCH 4/4] Renaming postgres.sql to postgresql.sql --- .../main/resources/dbscripts/cdm/{postgres.sql => postgresql.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/{postgres.sql => postgresql.sql} (100%) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgres.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql similarity index 100% rename from features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgres.sql rename to features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql