aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-07-20 15:15:09 +1000
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2018-07-20 15:15:09 +1000
commit2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec (patch)
tree416d58f180b4675b968a4ef725003e568cc9bf7d /src
parentc0afc0f51a0ed540bc2ada0ecbc01fa0e3b8b790 (diff)
parent4760ebee141cf44a0b07cd238a24cb676cd3da2f (diff)
downloadluaossl-2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec.tar.gz
luaossl-2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec.tar.bz2
luaossl-2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec.zip
Merge branch 'inherit-lookups'
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c
index c66c270..5d757a2 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -9937,9 +9937,15 @@ static int xp_interpose(lua_State *L) {
*/
static int xp_inherit(lua_State *L) {
X509_VERIFY_PARAM *dest = checksimple(L, 1, X509_VERIFY_PARAM_CLASS);
- X509_VERIFY_PARAM *src = checksimple(L, 2, X509_VERIFY_PARAM_CLASS);
+ X509_VERIFY_PARAM *src = testsimple(L, 2, X509_VERIFY_PARAM_CLASS);
int ret;
+ if (!src) {
+ luaL_argcheck(L, lua_isstring(L, 2), 2, "expected " X509_VERIFY_PARAM_CLASS " or string");
+ src = (X509_VERIFY_PARAM*)X509_VERIFY_PARAM_lookup(lua_tostring(L, 2));
+ luaL_argcheck(L, src != NULL, 2, "unknown param preset");
+ }
+
ret = X509_VERIFY_PARAM_inherit(dest, src);
if (!ret)
/* Note: openssl doesn't set an error as it should for some cases */