summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2015-07-14 01:10:25 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2015-07-14 01:10:25 +0300
commit3ac176fb86b49a436917d9a9874f0f98731a35f6 (patch)
tree666f757e185d4402dc7b218ee115f0bfb20faf9f /src
parent573810ce3668fdb21c2234f12bc05460dcc6810a (diff)
downloadnginx-3ac176fb86b49a436917d9a9874f0f98731a35f6.tar.gz
nginx-3ac176fb86b49a436917d9a9874f0f98731a35f6.tar.bz2
OCSP stapling: fixed segfault without nextUpdate.
OCSP responses may contain no nextUpdate. As per RFC 6960, this means that nextUpdate checks should be bypassed. Handle this gracefully by using NGX_MAX_TIME_T_VALUE as "valid" in such a case. The problem was introduced by 6893a1007a7c (1.9.2). Reported by Matthew Baldwin.
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_openssl_stapling.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/event/ngx_event_openssl_stapling.c b/src/event/ngx_event_openssl_stapling.c
index 60051ad47..fa776782c 100644
--- a/src/event/ngx_event_openssl_stapling.c
+++ b/src/event/ngx_event_openssl_stapling.c
@@ -637,11 +637,16 @@ ngx_ssl_stapling_ocsp_handler(ngx_ssl_ocsp_ctx_t *ctx)
goto error;
}
- valid = ngx_ssl_stapling_time(nextupdate);
- if (valid == (time_t) NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "invalid nextUpdate time in certificate status");
- goto error;
+ if (nextupdate) {
+ valid = ngx_ssl_stapling_time(nextupdate);
+ if (valid == (time_t) NGX_ERROR) {
+ ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
+ "invalid nextUpdate time in certificate status");
+ goto error;
+ }
+
+ } else {
+ valid = NGX_MAX_TIME_T_VALUE;
}
OCSP_CERTID_free(id);