diff options
author | Thomas Watson | 2011-09-26 20:44:21 +0000 |
---|---|---|
committer | Thomas Watson | 2011-09-26 20:44:21 +0000 |
commit | 6dc343762ea9f1c911bbd693903a26a0c063c969 (patch) | |
tree | eccc5d0e2053aaf6a43179295af137f871bf136e | |
parent | dbad33a7f9ccc7eeb91ad6fed66810e5cb450bc0 (diff) | |
download | rt.equinox.framework-6dc343762ea9f1c911bbd693903a26a0c063c969.tar.gz rt.equinox.framework-6dc343762ea9f1c911bbd693903a26a0c063c969.tar.xz rt.equinox.framework-6dc343762ea9f1c911bbd693903a26a0c063c969.zip |
Bug 355981 - SignedContent signing time wrong on Thai localev20110926-1551
-rw-r--r-- | bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java b/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java index 1e7ddc952..95a77db42 100644 --- a/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java +++ b/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2011 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -197,7 +197,11 @@ public class PKCS7Processor implements SignedContentConstants { dateFormatSB.append("'Z'"); //$NON-NLS-1$ try { - DateFormat dateFormt = new SimpleDateFormat(dateFormatSB.toString()); + // if the current locale is th_TH, or ja_JP_JP, then our dateFormat object will end up with + // a calendar such as Buddhist or Japanese Imperial Calendar, and the signing time will be + // incorrect ... so always use English as the locale for parsing the time, resulting in a + // Gregorian calendar + DateFormat dateFormt = new SimpleDateFormat(dateFormatSB.toString(), Locale.ENGLISH); dateFormt.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$ signingTime = dateFormt.parse(dateString); } catch (ParseException e) { |