Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355981

Summary: SignedContent signing time wrong on Thai locale
Product: [Eclipse Project] Equinox Reporter: Brian Lillie <brianlil>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mpcarl, tjwatson
Version: 3.7   
Target Milestone: Juno M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
test program
none
Patch to fix the issue tjwatson: iplog+

Description Brian Lillie CLA 2011-08-26 16:37:21 EDT
Build Identifier: 20110615-0604

In attempting to validate the code signing certificate, the signing time is retrieved from the SignedContent object.   

In PKCS7Processor class, method processEncapContentInfo the date is parsed using a SimpleDateFormat object.  With the Thai locale, the underlying calendar is a Buddhist calendar (with a Buddhist era), not the Gregorian calendar we are usually used to seeing, so the year ends up being off.

As a result, a date string that starts as something like 20110826101010 expecting to be parsed into a date object for year 2011 ends up with year value of something like 1468.

As a result, subsequent comparisons on the date object fail.


Reproducible: Always

Steps to Reproduce:
Attached project uses the SignedContentFactory to get the SignedContent and call getSigningTime.  It uses bundle org.eclipse.core.runtime.
Comment 1 Brian Lillie CLA 2011-08-26 16:37:50 EDT
Created attachment 202253 [details]
test program
Comment 2 Brian Lillie CLA 2011-09-25 16:34:38 EDT
Created attachment 203974 [details]
Patch to fix the issue
Comment 3 Thomas Watson CLA 2011-09-26 08:59:34 EDT
Thanks for the patch Brian!  I will review and release.
Comment 5 Thomas Watson CLA 2011-09-26 17:10:28 EDT
Comment on attachment 203974 [details]
Patch to fix the issue

Thanks Brian!