version 1.20, 2020/10/08 23:46:57 |
version 1.21, 2020/10/13 18:25:35 |
|
|
char *port); |
char *port); |
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp); |
static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp); |
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path, |
static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, char *path, |
STACK_OF(CONF_VALUE) *headers, OCSP_REQUEST *req, int req_timeout); |
STACK_OF(CONF_VALUE) *headers, const char *host, OCSP_REQUEST *req, |
|
int req_timeout); |
|
|
static struct { |
static struct { |
int accept_count; |
int accept_count; |
|
|
|
|
static OCSP_RESPONSE * |
static OCSP_RESPONSE * |
query_responder(BIO *err, BIO *cbio, char *path, STACK_OF(CONF_VALUE) *headers, |
query_responder(BIO *err, BIO *cbio, char *path, STACK_OF(CONF_VALUE) *headers, |
OCSP_REQUEST *req, int req_timeout) |
const char *host, OCSP_REQUEST *req, int req_timeout) |
{ |
{ |
int fd; |
int fd; |
int rv; |
int rv; |
int i; |
int i; |
|
int have_host = 0; |
OCSP_REQ_CTX *ctx = NULL; |
OCSP_REQ_CTX *ctx = NULL; |
OCSP_RESPONSE *rsp = NULL; |
OCSP_RESPONSE *rsp = NULL; |
struct pollfd pfd[1]; |
struct pollfd pfd[1]; |
|
|
|
|
for (i = 0; i < sk_CONF_VALUE_num(headers); i++) { |
for (i = 0; i < sk_CONF_VALUE_num(headers); i++) { |
CONF_VALUE *hdr = sk_CONF_VALUE_value(headers, i); |
CONF_VALUE *hdr = sk_CONF_VALUE_value(headers, i); |
|
if (strcasecmp("host", hdr->name) == 0) |
|
have_host = 1; |
if (!OCSP_REQ_CTX_add1_header(ctx, hdr->name, hdr->value)) |
if (!OCSP_REQ_CTX_add1_header(ctx, hdr->name, hdr->value)) |
goto err; |
goto err; |
} |
} |
|
|
|
if (!have_host) { |
|
if (!OCSP_REQ_CTX_add1_header(ctx, "Host", host)) |
|
goto err; |
|
} |
|
|
if (!OCSP_REQ_CTX_set1_req(ctx, req)) |
if (!OCSP_REQ_CTX_set1_req(ctx, req)) |
goto err; |
goto err; |
|
|
|
|
sbio = BIO_new_ssl(ctx, 1); |
sbio = BIO_new_ssl(ctx, 1); |
cbio = BIO_push(sbio, cbio); |
cbio = BIO_push(sbio, cbio); |
} |
} |
resp = query_responder(err, cbio, path, headers, req, req_timeout); |
resp = query_responder(err, cbio, path, headers, host, req, req_timeout); |
if (!resp) |
if (!resp) |
BIO_printf(bio_err, "Error querying OCSP responder\n"); |
BIO_printf(bio_err, "Error querying OCSP responder\n"); |
|
|