Skip to content

Commit

Permalink
validate and expose nextUpdate field in OCSP response
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvinEfendi committed Apr 18, 2020
1 parent 8966382 commit c122a4e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ngx_http_lua_ssl_ocsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ ngx_http_lua_ffi_ssl_create_ocsp_request(const char *chain_data,
int
ngx_http_lua_ffi_ssl_validate_ocsp_response(const u_char *resp,
size_t resp_len, const char *chain_data, size_t chain_len,
u_char *errbuf, size_t *errbuf_size)
u_char *errbuf, size_t *errbuf_size, time_t *valid)
{
#ifndef NGX_HTTP_LUA_USE_OCSP

Expand Down Expand Up @@ -383,6 +383,15 @@ ngx_http_lua_ffi_ssl_validate_ocsp_response(const u_char *resp,
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;
}
}

sk_X509_free(chain);
X509_free(cert);
X509_free(issuer);
Expand Down

0 comments on commit c122a4e

Please sign in to comment.