summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-17 11:26:33 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-17 17:26:38 +0100
commit8bcd6b8bf1acbd4fd9ae16a91a453b052e809f6d (patch)
tree46753754e97c8b0d0a400ff38ec0d2091b0ed998
parent157c9acfbee456c2eb796f39aafa1b85b0271313 (diff)
downloadgnutls-8bcd6b8bf1acbd4fd9ae16a91a453b052e809f6d.tar.gz
_gnutls_x509_generalTime2gtime: refuse to parse fractional seconds
Fractional seconds in GeneralizedTime are prohibited by RFC5280. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/x509/time.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/x509/time.c b/lib/x509/time.c
index 5ae6be01ee..39f47a85f3 100644
--- a/lib/x509/time.c
+++ b/lib/x509/time.c
@@ -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;