[squeak-dev] [error] DateAndTime changes produce different result on #readFrom:

Robert robert.withers at pm.me
Mon Mar 2 17:55:20 UTC 2020


Yes, my former method extension DateAndTime>>#milliSecond accessed #nanos. I changed this to call #utcMicroseconds and changed the name o fthe method to #milliseconds. This is in version 117 of Cryptography that I had released.

The remaining issue is DateAndtime class>>#readFrom: which completely changed implementations and also produced different results. This is a failure of DateAndTime to migrate to a new internal representation, while preserving identical results to former behavior. There are two representations of DateAndTime in tthe test method under discussion. One is the ASN1 representation and the other is an internet task force accepted textual representation. The new #readFrom: misrepresents the result from the textual  representation. This is a clear error in core DateAndTime, IMHO. The milliseconds are different, somehow.

K, r

On 3/2/20 12:48 PM, Marcel Taeumel wrote:

> Hi, there.
>
> The internal representation of DateAndTime changed from
>
> seconds
> offset
> jdn
> nanos
>
> in Squeak 5.2 to this in 5.3:
>
> utcMicroseconds
> localOffsetSeconds
>
> ---
>
> If tests in "Cryptography" relied on the internal representation of DateAndTime, those tests have to be adapted. Looking at ASN1Test >> #testUTCTime, this is the case:
>
> testUTCTime
>
> | bytes obj testObj newBytes |
> bytes := #[23 13 48 55 48 51 50 50 49 53 53 56 49 55 90].
> testObj := DateAndTime fromString: '2007-03-22T15:58:17+00:00'.
> obj := ASN1InputStream decodeBytes: bytes.
> self assert: (obj = testObj).
> newBytes := ASN1OutputStream encode: testObj.
> self assert: (bytes asByteArray = newBytes).
> newBytes := ASN1OutputStream encode: obj.
> self assert: (bytes asByteArray = newBytes).
>
> The "bytes" are different for (encoded) instances of DateAndTime in Squeak 5.3.
>
> Best,
> Marcel
>
>> Am 02.03.2020 18:31:51 schrieb Robert via Squeak-dev [<squeak-dev at lists.squeakfoundation.org>](mailto:squeak-dev at lists.squeakfoundation.org):
>>
>> In truth, this is an issue with incomplete DateAndTime testing. As there
>> are resulting differences, this ought to be tested  and modified in the
>> package containing the core DateAndTime definition and NOT an override
>> in the Cryptography package. I do not know who owns DateAndTime. I will
>> continue to slowly dig into the issue..
>>
>> K, r
>>
>> On 3/2/20 12:23 PM, Robert wrote:
>>> In calling this method:
>>>
>>> DateAndTime fromString: '2007-03-22T15:58:17+00:00'.
>>>
>>> The results in 5.3 are different than in 5.2. This is breaking 2
>>> ASN1Tests and 2 X509Tests. I am still in analysis of the decoding
>>> differences. The methods between the two versions are completely
>>> different. This breaks Cryptography.
>>>
>>> K, r
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200302/0fe62b73/attachment.html>


More information about the Squeak-dev mailing list