summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/openssl.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 59bcf1e..98043d9 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -8397,6 +8397,26 @@ static int ssl_getTLSextStatusType(lua_State *L) {
8397#endif 8397#endif
8398 8398
8399 8399
8400static int ssl_setTLSextStatusOCSPResp(lua_State *L) {
8401 SSL *ssl = checksimple(L, 1, SSL_CLASS);
8402 OCSP_RESPONSE *or = checksimple(L, 2, OCSP_RESPONSE_CLASS);
8403
8404 unsigned char *resp = NULL;
8405 long resp_len;
8406
8407 resp_len = i2d_OCSP_RESPONSE(or, &resp);
8408 if (resp_len <= 0)
8409 return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp");
8410
8411 if (!SSL_set_tlsext_status_ocsp_resp(ssl, resp, resp_len))
8412 return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp");
8413
8414 lua_pushboolean(L, 1);
8415
8416 return 1;
8417} /* ssl_setTLSextStatusOCSPResp() */
8418
8419
8400static int ssl_getTLSextStatusOCSPResp(lua_State *L) { 8420static int ssl_getTLSextStatusOCSPResp(lua_State *L) {
8401 SSL *ssl = checksimple(L, 1, SSL_CLASS); 8421 SSL *ssl = checksimple(L, 1, SSL_CLASS);
8402 8422
@@ -8456,6 +8476,7 @@ static const auxL_Reg ssl_methods[] = {
8456#if HAVE_SSL_GET_TLSEXT_STATUS_TYPE 8476#if HAVE_SSL_GET_TLSEXT_STATUS_TYPE
8457 { "getTLSextStatusType", &ssl_getTLSextStatusType }, 8477 { "getTLSextStatusType", &ssl_getTLSextStatusType },
8458#endif 8478#endif
8479 { "setTLSextStatusOCSPResp", &ssl_setTLSextStatusOCSPResp },
8459 { "getTLSextStatusOCSPResp", &ssl_getTLSextStatusOCSPResp }, 8480 { "getTLSextStatusOCSPResp", &ssl_getTLSextStatusOCSPResp },
8460 { NULL, NULL }, 8481 { NULL, NULL },
8461}; 8482};