diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-09-28 00:44:44 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-09-28 00:44:44 +0000 |
commit | d46c1a8126efe3942bc165af5bdf40fb145c1365 (patch) | |
tree | 2d975c7018d56761ed413e782b5602e99c3be82e /crypto/asn1/a_gentm.c | |
parent | e32587d5a605f897c6683c280c792b3b21fbaa36 (diff) |
Support fractional seconds in GeneralizedTime
Diffstat (limited to 'crypto/asn1/a_gentm.c')
-rw-r--r-- | crypto/asn1/a_gentm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index ef95003510..cd09f68b38 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -146,6 +146,19 @@ int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) if ((n < min[i]) || (n > max[i])) goto err; } + /* Optional fractional seconds: decimal point followed by one + * or more digits. + */ + if (a[o] == '.') + { + if (++o > l) goto err; + i = o; + while ((a[o] >= '0') && (a[o] <= '9') && (o <= l)) + o++; + /* Must have at least one digit after decimal point */ + if (i == o) goto err; + } + if (a[o] == 'Z') o++; else if ((a[o] == '+') || (a[o] == '-')) |