diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/openssl.c b/src/openssl.c index 59d4783..0de4f82 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -8434,14 +8434,18 @@ static int ssl_getTLSextStatusType(lua_State *L) { | |||
8434 | 8434 | ||
8435 | static int ssl_setTLSextStatusOCSPResp(lua_State *L) { | 8435 | static int ssl_setTLSextStatusOCSPResp(lua_State *L) { |
8436 | SSL *ssl = checksimple(L, 1, SSL_CLASS); | 8436 | SSL *ssl = checksimple(L, 1, SSL_CLASS); |
8437 | OCSP_RESPONSE *or = checksimple(L, 2, OCSP_RESPONSE_CLASS); | 8437 | OCSP_RESPONSE *or = testsimple(L, 2, OCSP_RESPONSE_CLASS); |
8438 | 8438 | ||
8439 | unsigned char *resp = NULL; | 8439 | unsigned char *resp = NULL; |
8440 | long resp_len; | 8440 | long resp_len; |
8441 | 8441 | ||
8442 | resp_len = i2d_OCSP_RESPONSE(or, &resp); | 8442 | if (or) { |
8443 | if (resp_len <= 0) | 8443 | resp_len = i2d_OCSP_RESPONSE(or, &resp); |
8444 | return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp"); | 8444 | if (resp_len <= 0) |
8445 | return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp"); | ||
8446 | } else { | ||
8447 | resp_len = 0; | ||
8448 | } | ||
8445 | 8449 | ||
8446 | if (!SSL_set_tlsext_status_ocsp_resp(ssl, resp, resp_len)) | 8450 | if (!SSL_set_tlsext_status_ocsp_resp(ssl, resp, resp_len)) |
8447 | return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp"); | 8451 | return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp"); |