aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-11-08 16:58:33 +1100
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-11-08 16:58:33 +1100
commit8327753dd8f85e2a971e778389f974614146e12d (patch)
treec222f3532470d7bbba4d5d13b2fef0f235db7d2d
parentd74ec1dc86f4e0e9b3f677628ed136ca4139668c (diff)
downloadluaossl-8327753dd8f85e2a971e778389f974614146e12d.tar.gz
luaossl-8327753dd8f85e2a971e778389f974614146e12d.tar.bz2
luaossl-8327753dd8f85e2a971e778389f974614146e12d.zip
openssl.pkey: Use reset bio after :encrypt() and :decrypt()
-rw-r--r--src/openssl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 85c7503..8ff21ce 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -3225,12 +3225,15 @@ static int pk_decrypt(lua_State *L) {
lua_pushlstring(L, buf->data, outlen);
+ BIO_reset(*bio);
+
return 1;
sslerr:
if (ctx) {
EVP_PKEY_CTX_free(ctx);
ctx = NULL;
}
+ BIO_reset(*bio);
return auxL_error(L, auxL_EOPENSSL, "pkey:decrypt");
} /* pk_decrypt() */
@@ -3280,12 +3283,15 @@ static int pk_encrypt(lua_State *L) {
lua_pushlstring(L, buf->data, outlen);
+ BIO_reset(*bio);
+
return 1;
sslerr:
if (ctx) {
EVP_PKEY_CTX_free(ctx);
ctx = NULL;
}
+ BIO_reset(*bio);
return auxL_error(L, auxL_EOPENSSL, "pkey:encrypt");
} /* pk_encrypt() */