diff options
author | daurnimator <quae@daurnimator.com> | 2018-07-20 15:15:09 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-07-20 15:15:09 +1000 |
commit | 2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec (patch) | |
tree | 416d58f180b4675b968a4ef725003e568cc9bf7d | |
parent | c0afc0f51a0ed540bc2ada0ecbc01fa0e3b8b790 (diff) | |
parent | 4760ebee141cf44a0b07cd238a24cb676cd3da2f (diff) | |
download | luaossl-2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec.tar.gz luaossl-2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec.tar.bz2 luaossl-2fc743e9a8f37a2ffe1785ce6dbcc773a81010ec.zip |
Merge branch 'inherit-lookups'
-rw-r--r-- | src/openssl.c | 8 |
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 */ |