aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-11-14 14:09:41 +1100
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-11-14 14:32:39 +1100
commit73a56ebd71ab15006f699e3719e049161091253b (patch)
tree50e54927e741af56dd1f881ded3110ed34149ffd
parentcb727f97f2e00512c70631210de2d8b951e81587 (diff)
downloadluaossl-73a56ebd71ab15006f699e3719e049161091253b.tar.gz
luaossl-73a56ebd71ab15006f699e3719e049161091253b.tar.bz2
luaossl-73a56ebd71ab15006f699e3719e049161091253b.zip
Fill in ssl_new
-rw-r--r--src/openssl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 4564061..78ab3a0 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -7609,7 +7609,13 @@ static SSL *ssl_push(lua_State *L, SSL *ssl) {
} /* ssl_push() */
static int ssl_new(lua_State *L) {
- lua_pushnil(L);
+ SSL_CTX *ctx = checksimple(L, 1, SSL_CTX_CLASS);
+ SSL **ud = prepsimple(L, SSL_CLASS);
+
+ *ud = SSL_new(ctx);
+
+ if (!*ud)
+ return auxL_error(L, auxL_EOPENSSL, "ssl.new");
return 1;
} /* ssl_new() */