20e580
From a6fd897651ab28ca79a36b38eab7b107357cc218 Mon Sep 17 00:00:00 2001
20e580
From: Alexander Scheel <ascheel@redhat.com>
20e580
Date: Mon, 13 Apr 2020 09:27:50 -0400
20e580
Subject: [PATCH 1/4] Remove space from AlgorithmId.toString()
20e580
20e580
In cadc299fa69554e2e7ab9226298be639219476ab and v4.4.x commit
20e580
e1ee07a3c19cd15d7dab1dedf383128a2b83b925, AlgorithmId was updated
20e580
to unconditionally add an extra space to toString, to separate the
20e580
algorithm name from the parameters. This suffices in some cases, but
20e580
AlgorithmId.toString() is used by PKI to compare against a tokenized
20e580
list of characters. Removing the extraneous whitespace was the solution
20e580
proposed in PKI commit 53de751485b04fe2a1555228342ed642c9a9e347, but
20e580
this should really be handled in JSS instead of PKI.
20e580
20e580
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
20e580
---
20e580
 org/mozilla/jss/netscape/security/x509/AlgorithmId.java | 6 +++++-
20e580
 1 file changed, 5 insertions(+), 1 deletion(-)
20e580
20e580
diff --git a/org/mozilla/jss/netscape/security/x509/AlgorithmId.java b/org/mozilla/jss/netscape/security/x509/AlgorithmId.java
20e580
index 46c5a258..9936b6e9 100644
20e580
--- a/org/mozilla/jss/netscape/security/x509/AlgorithmId.java
20e580
+++ b/org/mozilla/jss/netscape/security/x509/AlgorithmId.java
20e580
@@ -627,7 +627,11 @@ public class AlgorithmId implements Serializable, DerEncoder {
20e580
      * Returns a string describing the algorithm and its parameters.
20e580
      */
20e580
     public String toString() {
20e580
-        return (algName() + " " + paramsToString());
20e580
+        if (params == null) {
20e580
+            return algName();
20e580
+        }
20e580
+
20e580
+        return algName() + " " + paramsToString();
20e580
     }
20e580
 
20e580
     /**
20e580
-- 
20e580
2.26.2
20e580