aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-12-19 03:05:42 +1100
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-12-20 22:41:49 +1100
commita92a050cb5d2c2e87ec855632bceef30791d8984 (patch)
tree8fd682aad5f6198ba50ffa9c14a6356bcde5e25c
parent55c385971e421c9eed9d5f3e43c8ad768c3cecab (diff)
downloadluaossl-a92a050cb5d2c2e87ec855632bceef30791d8984.tar.gz
luaossl-a92a050cb5d2c2e87ec855632bceef30791d8984.tar.bz2
luaossl-a92a050cb5d2c2e87ec855632bceef30791d8984.zip
Add ssl:setTLSextStatusOCSPResp()
Currently useless without a way to set a callback for tlsext
-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) {
#endif
+static int ssl_setTLSextStatusOCSPResp(lua_State *L) {
+ SSL *ssl = checksimple(L, 1, SSL_CLASS);
+ OCSP_RESPONSE *or = checksimple(L, 2, OCSP_RESPONSE_CLASS);
+
+ unsigned char *resp = NULL;
+ long resp_len;
+
+ resp_len = i2d_OCSP_RESPONSE(or, &resp);
+ if (resp_len <= 0)
+ return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp");
+
+ if (!SSL_set_tlsext_status_ocsp_resp(ssl, resp, resp_len))
+ return auxL_error(L, auxL_EOPENSSL, "ssl:setTLSextStatusOCSPResp");
+
+ lua_pushboolean(L, 1);
+
+ return 1;
+} /* ssl_setTLSextStatusOCSPResp() */
+
+
static int ssl_getTLSextStatusOCSPResp(lua_State *L) {
SSL *ssl = checksimple(L, 1, SSL_CLASS);
@@ -8456,6 +8476,7 @@ static const auxL_Reg ssl_methods[] = {
#if HAVE_SSL_GET_TLSEXT_STATUS_TYPE
{ "getTLSextStatusType", &ssl_getTLSextStatusType },
#endif
+ { "setTLSextStatusOCSPResp", &ssl_setTLSextStatusOCSPResp },
{ "getTLSextStatusOCSPResp", &ssl_getTLSextStatusOCSPResp },
{ NULL, NULL },
};