Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355981 - SignedContent signing time wrong on Thai locale
Summary: SignedContent signing time wrong on Thai locale
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Juno M3   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-26 16:37 EDT by Brian Lillie CLA
Modified: 2011-09-26 17:10 EDT (History)
2 users (show)

See Also:


Attachments
test program (1.97 KB, application/octet-stream)
2011-08-26 16:37 EDT, Brian Lillie CLA
no flags Details
Patch to fix the issue (1.33 KB, patch)
2011-09-25 16:34 EDT, Brian Lillie CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!