aboutsummaryrefslogtreecommitdiffstats
path: root/src/openssl.c
diff options
context:
space:
mode:
authorLibravatarLibravatar Wangchong Zhou <fffonion@gmail.com> 2020-02-03 15:35:13 +0800
committerLibravatarLibravatar Wangchong Zhou <fffonion@gmail.com> 2020-02-05 13:53:12 +0800
commite48a9babbfcf3a481d5a9358c8282c497ab08cf7 (patch)
tree4cd738f7fb41030944f68158526c6a1faff64b8e /src/openssl.c
parent5ad909dc20779534a7221010d0220865347aedfc (diff)
downloadluaossl-e48a9babbfcf3a481d5a9358c8282c497ab08cf7.tar.gz
luaossl-e48a9babbfcf3a481d5a9358c8282c497ab08cf7.tar.bz2
luaossl-e48a9babbfcf3a481d5a9358c8282c497ab08cf7.zip
src/openssl.c: reset bio pointer before reuse in X509_ANY format
Diffstat (limited to 'src/openssl.c')
-rw-r--r--src/openssl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 9a9de0f..c3547bb 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -6412,6 +6412,7 @@ static int xc_new(lua_State *L) {
}
if (!ok && (type == X509_DER || type == X509_ANY)) {
+ BIO_reset(tmp);
ok = !!(*ud = d2i_X509_bio(tmp, NULL));
}
@@ -7611,6 +7612,7 @@ static int xr_new(lua_State *L) {
}
if (!ok && (type == X509_DER || type == X509_ANY)) {
+ BIO_reset(tmp);
ok = !!(*ud = d2i_X509_REQ_bio(tmp, NULL));
}
@@ -8037,6 +8039,7 @@ static int xx_new(lua_State *L) {
}
if (!ok && (type == X509_DER || type == X509_ANY)) {
+ BIO_reset(tmp);
ok = !!(*ud = d2i_X509_CRL_bio(tmp, NULL));
}