diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2016-03-05 16:09:21 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2016-03-05 16:09:21 +0000 |
commit | 3a4a4def5d0538733309bd1fafaacfccb6b4eded (patch) | |
tree | 4d440a32f2249fac950faea03d36f4aad2fa140c /usr.sbin | |
parent | 70699e922db45e6154167b32ff995d5d7f4f6730 (diff) |
According to RFC7231, section 7.1.1.1, the HTTP date header supports
no other timezone than the fixed string "GMT". Avoid using strptime %Z,
which is nonstandard and can give surprising results on other operating
systems. ok deraadt@ giovanni@ bcook@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/constraint.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/constraint.c b/usr.sbin/ntpd/constraint.c index 169007e4bde..e09c654ddf4 100644 --- a/usr.sbin/ntpd/constraint.c +++ b/usr.sbin/ntpd/constraint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: constraint.c,v 1.25 2016/01/27 21:48:34 reyk Exp $ */ +/* $OpenBSD: constraint.c,v 1.26 2016/03/05 16:09:20 naddy Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -903,7 +903,7 @@ httpsdate_request(struct httpsdate *httpsdate, struct timeval *when) * or ANSI C's asctime() - the latter doesn't include * the timezone which is required here. */ - if (strptime(p, "%a, %d %h %Y %T %Z", + if (strptime(p, "%a, %d %h %Y %T GMT", &httpsdate->tls_tm) == NULL) { log_warnx("unsupported date format"); free(line); |