]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
_gnutls_x509_generalTime2gtime: refuse to parse fractional seconds
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 17 Feb 2017 10:26:33 +0000 (11:26 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 17 Feb 2017 16:26:38 +0000 (17:26 +0100)
Fractional seconds in GeneralizedTime are prohibited by RFC5280.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/x509/time.c

index 5ae6be01ee344a651b2b32c63a22f5a95f4a7d8f..39f47a85f31d39e99d7a5779063c0560b7e5d292 100644 (file)
@@ -207,8 +207,13 @@ time_t _gnutls_x509_generalTime2gtime(const char *ttime)
 
        if (strchr(ttime, 'Z') == 0) {
                gnutls_assert();
-               /* sorry we don't support it yet
-                */
+               /* required to be in GMT */
+               return (time_t) - 1;
+       }
+
+       if (strchr(ttime, '.') != 0) {
+               gnutls_assert();
+               /* no fractional seconds allowed */
                return (time_t) - 1;
        }
        xx[4] = 0;