summaryrefslogtreecommitdiffstats
path: root/pki/base
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-02-21 22:22:16 -0600
committerEndi Sukma Dewata <edewata@redhat.com>2012-02-23 21:15:27 -0600
commited31fc445fc6d4769b7bd119770ae1da9b15d2bf (patch)
tree6d01d561bba4d2c505c22355522d8b30041f747a /pki/base
parent970e3667eede41e72bb5a4cadf1d056ff526d944 (diff)
downloadpki-ed31fc445fc6d4769b7bd119770ae1da9b15d2bf.tar.gz
pki-ed31fc445fc6d4769b7bd119770ae1da9b15d2bf.tar.xz
pki-ed31fc445fc6d4769b7bd119770ae1da9b15d2bf.zip
Replaced BtoA/AtoB with Apache codec.
The OSUtil's BtoA() and AtoB() have been replaced by Base64 codec from Apache Commons library. The codec is configured to use 64-byte line width as defined in RFC 1421. Ticket #90
Diffstat (limited to 'pki/base')
-rw-r--r--pki/base/ca/src/CMakeLists.txt9
-rw-r--r--pki/base/common/src/CMakeLists.txt9
-rw-r--r--pki/base/common/test/CMakeLists.txt4
-rw-r--r--pki/base/console/src/CMakeLists.txt10
-rw-r--r--pki/base/java-tools/src/CMakeLists.txt9
-rw-r--r--pki/base/java-tools/templates/pki_java_command_wrapper.in1
-rw-r--r--pki/base/java-tools/templates/pretty_print_cert_command_wrapper.in1
-rw-r--r--pki/base/java-tools/templates/pretty_print_crl_command_wrapper.in1
-rw-r--r--pki/base/kra/src/CMakeLists.txt9
-rw-r--r--pki/base/ocsp/src/CMakeLists.txt9
-rwxr-xr-xpki/base/setup/pkicreate14
-rwxr-xr-xpki/base/silent/scripts/pkisilent1
-rw-r--r--pki/base/silent/src/CMakeLists.txt2
-rw-r--r--pki/base/tks/src/CMakeLists.txt9
-rw-r--r--pki/base/util/src/CMakeLists.txt9
-rw-r--r--pki/base/util/src/com/netscape/cmsutil/util/Utils.java6
-rw-r--r--pki/base/util/test/CMakeLists.txt4
17 files changed, 92 insertions, 15 deletions
diff --git a/pki/base/ca/src/CMakeLists.txt b/pki/base/ca/src/CMakeLists.txt
index 2adda5467..188b95493 100644
--- a/pki/base/ca/src/CMakeLists.txt
+++ b/pki/base/ca/src/CMakeLists.txt
@@ -24,6 +24,13 @@ find_file(OSUTIL_JAR
${JAVA_LIB_INSTALL_DIR}
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
# identify java sources
set(pki-ca_java_SRCS
@@ -42,7 +49,7 @@ set(CMAKE_JAVA_INCLUDE_PATH
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
${LDAPJDK_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
# set version
diff --git a/pki/base/common/src/CMakeLists.txt b/pki/base/common/src/CMakeLists.txt
index 6d78f2fdd..1deeb470a 100644
--- a/pki/base/common/src/CMakeLists.txt
+++ b/pki/base/common/src/CMakeLists.txt
@@ -24,6 +24,13 @@ find_file(OSUTIL_JAR
/usr/share/java
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(SERVLET_JAR
NAMES
servlet.jar
@@ -1032,7 +1039,7 @@ set(pki-cmsbundle_RCS
set(CMAKE_JAVA_INCLUDE_PATH
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR} ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR} ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR})
set(CMAKE_JAVA_TARGET_VERSION ${APPLICATION_VERSION})
diff --git a/pki/base/common/test/CMakeLists.txt b/pki/base/common/test/CMakeLists.txt
index 7ded236f0..4d266683d 100644
--- a/pki/base/common/test/CMakeLists.txt
+++ b/pki/base/common/test/CMakeLists.txt
@@ -57,7 +57,7 @@ set(CMAKE_JAVA_INCLUDE_PATH
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR} ${PKI_CMSBUNDLE_JAR}
${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR}
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR}
${PKI_TEST_JAR} ${JUNIT_JAR}
)
@@ -83,7 +83,7 @@ add_junit_test(test-pki-common
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR} ${PKI_CMSBUNDLE_JAR}
${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR}
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR}
${PKI_TEST_JAR} ${JUNIT_JAR}
TESTS
com.netscape.certsrv.authentication.AuthTokenTest
diff --git a/pki/base/console/src/CMakeLists.txt b/pki/base/console/src/CMakeLists.txt
index b8a897757..3d88cceda 100644
--- a/pki/base/console/src/CMakeLists.txt
+++ b/pki/base/console/src/CMakeLists.txt
@@ -77,6 +77,13 @@ find_file(OSUTIL_JAR
/usr/share/java
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
# identify java sources
set(pki-console_java_SRCS
@@ -648,7 +655,8 @@ set(CMAKE_JAVA_INCLUDE_PATH
${MMC_EN_JAR} ${NMCLF_JAR} ${NMCLF_EN_JAR}
${PKI_NSUTIL_JAR}
${JSS_JAR}
- ${OSUTIL_JAR})
+ ${OSUTIL_JAR}
+ ${COMMONS_CODEC_JAR})
# set version
diff --git a/pki/base/java-tools/src/CMakeLists.txt b/pki/base/java-tools/src/CMakeLists.txt
index 90fe31ae4..17c6f6b68 100644
--- a/pki/base/java-tools/src/CMakeLists.txt
+++ b/pki/base/java-tools/src/CMakeLists.txt
@@ -16,6 +16,13 @@ find_file(OSUTIL_JAR
/usr/share/java
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(XALAN_JAR
NAMES
xalan-j2.jar
@@ -60,7 +67,7 @@ set(pki-tools_java_SRCS
set(CMAKE_JAVA_INCLUDE_PATH
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
${XALAN_JAR} ${XERCES_JAR}
- ${JSS_JAR} ${OSUTIL_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR})
set(CMAKE_JAVA_TARGET_VERSION ${APPLICATION_VERSION})
diff --git a/pki/base/java-tools/templates/pki_java_command_wrapper.in b/pki/base/java-tools/templates/pki_java_command_wrapper.in
index 4136eeebb..b09740945 100644
--- a/pki/base/java-tools/templates/pki_java_command_wrapper.in
+++ b/pki/base/java-tools/templates/pki_java_command_wrapper.in
@@ -142,6 +142,7 @@ if [ "${OS}" = "Linux" ] &&
# Fedora 16+
CP=/usr/lib64/java/osutil.jar:${CP}
fi
+CP=/usr/share/java/commons-codec.jar:${CP}
CP=/usr/share/java/ldapjdk.jar:${CP}
CP=/usr/share/java/${PRODUCT}/pki-nsutil.jar:${CP}
CP=/usr/share/java/${PRODUCT}/pki-cmsutil.jar:${CP}
diff --git a/pki/base/java-tools/templates/pretty_print_cert_command_wrapper.in b/pki/base/java-tools/templates/pretty_print_cert_command_wrapper.in
index fe0262c8c..ec1f2a9f8 100644
--- a/pki/base/java-tools/templates/pretty_print_cert_command_wrapper.in
+++ b/pki/base/java-tools/templates/pretty_print_cert_command_wrapper.in
@@ -142,6 +142,7 @@ if [ "${OS}" = "Linux" ] &&
# Fedora 16+
CP=/usr/lib64/java/osutil.jar:${CP}
fi
+CP=/usr/share/java/commons-codec.jar:${CP}
CP=/usr/share/java/ldapjdk.jar:${CP}
CP=/usr/share/java/${PRODUCT}/pki-nsutil.jar:${CP}
CP=/usr/share/java/${PRODUCT}/pki-cmsutil.jar:${CP}
diff --git a/pki/base/java-tools/templates/pretty_print_crl_command_wrapper.in b/pki/base/java-tools/templates/pretty_print_crl_command_wrapper.in
index 333983a47..2fb27f699 100644
--- a/pki/base/java-tools/templates/pretty_print_crl_command_wrapper.in
+++ b/pki/base/java-tools/templates/pretty_print_crl_command_wrapper.in
@@ -142,6 +142,7 @@ if [ "${OS}" = "Linux" ] &&
# Fedora 16+
CP=/usr/lib64/java/osutil.jar:${CP}
fi
+CP=/usr/share/java/commons-codec.jar:${CP}
CP=/usr/share/java/ldapjdk.jar:${CP}
CP=/usr/share/java/${PRODUCT}/pki-nsutil.jar:${CP}
CP=/usr/share/java/${PRODUCT}/pki-cmsutil.jar:${CP}
diff --git a/pki/base/kra/src/CMakeLists.txt b/pki/base/kra/src/CMakeLists.txt
index d265eeecd..5e1b06782 100644
--- a/pki/base/kra/src/CMakeLists.txt
+++ b/pki/base/kra/src/CMakeLists.txt
@@ -62,6 +62,13 @@ find_file(OSUTIL_JAR
${JAVA_LIB_INSTALL_DIR}
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(SYMKEY_JAR
NAMES
symkey.jar
@@ -94,7 +101,7 @@ set(CMAKE_JAVA_INCLUDE_PATH
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
${LDAPJDK_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
# set version
diff --git a/pki/base/ocsp/src/CMakeLists.txt b/pki/base/ocsp/src/CMakeLists.txt
index f7cb01405..ad16cebab 100644
--- a/pki/base/ocsp/src/CMakeLists.txt
+++ b/pki/base/ocsp/src/CMakeLists.txt
@@ -62,6 +62,13 @@ find_file(OSUTIL_JAR
${JAVA_LIB_INSTALL_DIR}
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(SYMKEY_JAR
NAMES
symkey.jar
@@ -84,7 +91,7 @@ set(CMAKE_JAVA_INCLUDE_PATH
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
${LDAPJDK_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
# set version
diff --git a/pki/base/setup/pkicreate b/pki/base/setup/pkicreate
index 528c9a423..a98286e8a 100755
--- a/pki/base/setup/pkicreate
+++ b/pki/base/setup/pkicreate
@@ -181,6 +181,7 @@ my $jss_jar_base_name = "jss4.jar"; # CA, KRA, OCSP, TKS
my $ldapjdk_jar_base_name = "ldapjdk.jar"; # CA, KRA, OCSP, TKS
my $pki_nsutil_jar_base_name = "pki-nsutil.jar"; # CA, KRA, OCSP, TKS
my $osutil_jar_base_name = "osutil.jar"; # CA, KRA, OCSP, TKS
+my $commons_codec_jar_base_name = "commons-codec.jar"; # CA, KRA, OCSP, TKS
my $symkey_jar_base_name = "symkey.jar"; # CA, KRA, OCSP, TKS
my $tomcatjss_jar_base_name = "tomcatjss.jar"; # CA, KRA, OCSP, TKS
my $velocity_jar_base_name = "velocity.jar"; # CA, KRA, OCSP, TKS
@@ -502,6 +503,8 @@ my $pki_nsutil_jar_file_path = undef; # CA, KRA, OCSP, TKS
my $pki_nsutil_jar_symlink_path = undef; # CA, KRA, OCSP, TKS
my $osutil_jar_file_path = undef; # CA, KRA, OCSP, TKS
my $osutil_jar_symlink_path = undef; # CA, KRA, OCSP, TKS
+my $commons_codec_jar_file_path = undef; # CA, KRA, OCSP, TKS
+my $commons_codec_jar_symlink_path = undef; # CA, KRA, OCSP, TKS
my $symkey_jar_file_path = undef; # CA, KRA, OCSP, TKS
my $symkey_jar_symlink_path = undef; # CA, KRA, OCSP, TKS
my $tomcatjss_jar_file_path = undef; # CA, KRA, OCSP, TKS
@@ -1838,6 +1841,11 @@ sub initialize_subdirectory_paths
return 0;
}
+ if (!defined($commons_codec_jar_file_path = find_jar($commons_codec_jar_base_name))) {
+ emit("could not find jar: $commons_codec_jar_base_name", "error");
+ return 0;
+ }
+
if (!defined($pki_subsystem_jar_file_path = find_jar($pki_subsystem_jar_base_name))) {
emit("could not find jar: $pki_subsystem_jar_base_name", "error");
return 0;
@@ -1946,6 +1954,8 @@ sub initialize_subdirectory_paths
. "/" . $pki_nsutil_jar_base_name;
$osutil_jar_symlink_path = $webinf_lib_instance_path
. "/" . $osutil_jar_base_name;
+ $commons_codec_jar_symlink_path = $webinf_lib_instance_path
+ . "/" . $commons_codec_jar_base_name;
$symkey_jar_symlink_path = $webinf_lib_instance_path
. "/" . $symkey_jar_base_name;
$pki_subsystem_jar_symlink_path = $webinf_lib_instance_path
@@ -2965,6 +2975,10 @@ sub process_pki_files_and_symlinks
return 0 if !create_symlink($osutil_jar_symlink_path, $osutil_jar_file_path,
$pki_user, $pki_group);
+ # create instance symlink to "commons_codec.jar"
+ return 0 if !create_symlink($commons_codec_jar_symlink_path, $commons_codec_jar_file_path,
+ $pki_user, $pki_group);
+
# create instance symlink to "${subsystem_type}.jar"
return 0 if !create_symlink($pki_subsystem_jar_symlink_path, $pki_subsystem_jar_file_path,
$pki_user, $pki_group);
diff --git a/pki/base/silent/scripts/pkisilent b/pki/base/silent/scripts/pkisilent
index 778c40036..46e6805c2 100755
--- a/pki/base/silent/scripts/pkisilent
+++ b/pki/base/silent/scripts/pkisilent
@@ -83,6 +83,7 @@ $ENV{CLASSPATH} = "/usr/share/java/${PRODUCT}/pki-silent.jar:"
. "/usr/share/java/${PRODUCT}/pki-cmsutil.jar:"
. "/usr/share/java/${PRODUCT}/pki-tools.jar:"
. "/usr/share/java/ldapjdk.jar:"
+ . "/usr/share/java/commons-codec.jar:"
. "/usr/share/java/xerces-j2.jar:"
. "/usr/share/java/xml-commons-apis.jar:"
. "/usr/share/java/xml-commons-resolver.jar:";
diff --git a/pki/base/silent/src/CMakeLists.txt b/pki/base/silent/src/CMakeLists.txt
index b610df96d..dc1b8ebe3 100644
--- a/pki/base/silent/src/CMakeLists.txt
+++ b/pki/base/silent/src/CMakeLists.txt
@@ -75,7 +75,7 @@ set(CMAKE_JAVA_INCLUDE_PATH
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR}
${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
${LDAPJDK_JAR} ${XERCES_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
set(CMAKE_JAVA_TARGET_VERSION ${APPLICATION_VERSION})
diff --git a/pki/base/tks/src/CMakeLists.txt b/pki/base/tks/src/CMakeLists.txt
index caeda0185..2542c951c 100644
--- a/pki/base/tks/src/CMakeLists.txt
+++ b/pki/base/tks/src/CMakeLists.txt
@@ -62,6 +62,13 @@ find_file(OSUTIL_JAR
${JAVA_LIB_INSTALL_DIR}
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(SYMKEY_JAR
NAMES
symkey.jar
@@ -81,7 +88,7 @@ set(CMAKE_JAVA_INCLUDE_PATH
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
${LDAPJDK_JAR}
- ${JSS_JAR} ${OSUTIL_JAR} ${SYMKEY_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
# set version
diff --git a/pki/base/util/src/CMakeLists.txt b/pki/base/util/src/CMakeLists.txt
index 919b593e7..0c78ac3b7 100644
--- a/pki/base/util/src/CMakeLists.txt
+++ b/pki/base/util/src/CMakeLists.txt
@@ -24,6 +24,13 @@ find_file(OSUTIL_JAR
/usr/share/java
)
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
find_file(XALAN_JAR
NAMES
xalan-j2.jar
@@ -332,7 +339,7 @@ set(pki-cmsutil_java_SRCS
set(CMAKE_JAVA_INCLUDE_PATH
${LDAPJDK_JAR} ${XALAN_JAR} ${XERCES_JAR}
- ${JSS_JAR} ${OSUTIL_JAR})
+ ${JSS_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR})
set(CMAKE_JAVA_TARGET_VERSION ${APPLICATION_VERSION})
diff --git a/pki/base/util/src/com/netscape/cmsutil/util/Utils.java b/pki/base/util/src/com/netscape/cmsutil/util/Utils.java
index a1801785c..303566416 100644
--- a/pki/base/util/src/com/netscape/cmsutil/util/Utils.java
+++ b/pki/base/util/src/com/netscape/cmsutil/util/Utils.java
@@ -17,6 +17,8 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmsutil.util;
+import org.apache.commons.codec.binary.Base64;
+
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
@@ -263,12 +265,12 @@ public class Utils {
}
public static String base64encode(byte[] bytes) {
- String string = com.netscape.osutil.OSUtil.BtoA(bytes);
+ String string = new Base64(64).encodeToString(bytes);
return string;
}
public static byte[] base64decode(String string) {
- byte[] bytes = com.netscape.osutil.OSUtil.AtoB(string);
+ byte[] bytes = Base64.decodeBase64(string);
return bytes;
}
}
diff --git a/pki/base/util/test/CMakeLists.txt b/pki/base/util/test/CMakeLists.txt
index b9aa4eb16..042731f3b 100644
--- a/pki/base/util/test/CMakeLists.txt
+++ b/pki/base/util/test/CMakeLists.txt
@@ -19,7 +19,7 @@ set(pki-util-test_SRCS
set(CMAKE_JAVA_INCLUDE_PATH
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
- ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR} ${XALAN_JAR} ${XERCES_JAR}
+ ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR} ${XALAN_JAR} ${XERCES_JAR}
${PKI_TEST_JAR} ${JUNIT_JAR}
)
@@ -39,7 +39,7 @@ add_junit_test(test-pki-util
CLASSPATH
${pki-util-test_JAR_FILE}
${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
- ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR}
+ ${JSS_JAR} ${LDAPJDK_JAR} ${OSUTIL_JAR} ${COMMONS_CODEC_JAR}
${PKI_TEST_JAR} ${JUNIT_JAR}
TESTS
com.netscape.security.util.BMPStringTest