From: Sergey Matveev Date: Thu, 21 Nov 2024 08:25:34 +0000 (+0300) Subject: Zero nsecs is ok for TAI64NA X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e83df73c8da41f90a090dc0ceed083e3ab95a504f72e206dd842226259a18564;p=keks.git Zero nsecs is ok for TAI64NA --- diff --git a/pyac/pyac.py b/pyac/pyac.py index 92f0ec4..670d88a 100755 --- a/pyac/pyac.py +++ b/pyac/pyac.py @@ -298,7 +298,7 @@ def loads(v, sets=False, leapsecUTCAllow=False): nsecs = 0 if l > 8: nsecs = int.from_bytes(v[1+8:1+8+4], "big") - if nsecs == 0: + if (l == 8) and (nsecs == 0): raise DecodeError("non-minimal encoding") if nsecs > 999999999: raise DecodeError("too many nanoseconds")