aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_gentm.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-09-28 00:44:44 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-09-28 00:44:44 +0000
commitd46c1a8126efe3942bc165af5bdf40fb145c1365 (patch)
tree2d975c7018d56761ed413e782b5602e99c3be82e /crypto/asn1/a_gentm.c
parente32587d5a605f897c6683c280c792b3b21fbaa36 (diff)
downloadopenssl-d46c1a8126efe3942bc165af5bdf40fb145c1365.tar.gz
Support fractional seconds in GeneralizedTime
Diffstat (limited to 'crypto/asn1/a_gentm.c')
-rw-r--r--crypto/asn1/a_gentm.c13
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] == '-'))