changeset 5823:901e346b6238

8009617: jarsigner fails when TSA response contains a status string Reviewed-by: mullan
author weijun
date Fri, 08 Mar 2013 17:39:32 +0800
parents 2578df0c85f1
children a13cb8924de8
files src/share/classes/sun/security/timestamp/TSResponse.java test/sun/security/tools/jarsigner/TimestampCheck.java
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/timestamp/TSResponse.java	Wed Dec 21 10:06:32 2011 +0000
+++ b/src/share/classes/sun/security/timestamp/TSResponse.java	Fri Mar 08 17:39:32 2013 +0800
@@ -341,7 +341,7 @@
             DerValue[] strings = status.data.getSequence(1);
             statusString = new String[strings.length];
             for (int i = 0; i < strings.length; i++) {
-                statusString[i] = strings[i].data.getUTF8String();
+                statusString[i] = strings[i].getUTF8String();
             }
         }
         // Parse failInfo, if present
--- a/test/sun/security/tools/jarsigner/TimestampCheck.java	Wed Dec 21 10:06:32 2011 +0000
+++ b/test/sun/security/tools/jarsigner/TimestampCheck.java	Fri Mar 08 17:39:32 2013 +0800
@@ -129,6 +129,9 @@
 
             DerOutputStream statusInfo = new DerOutputStream();
             statusInfo.putInteger(0);
+            DerOutputStream statusStrings = new DerOutputStream();
+            statusStrings.putUTF8String("Status for " + path);
+            statusInfo.write(DerValue.tag_Sequence, statusStrings);
 
             DerOutputStream token = new DerOutputStream();
             AlgorithmId[] algorithms = {aid};