aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@25thandClement.com> 2015-12-18 14:08:28 +0800
committerLibravatarLibravatar William Ahern <william@25thandClement.com> 2015-12-18 14:08:28 +0800
commitb105f09ccc6ef4a90b97745f50a46a5910edcdc1 (patch)
treec05c926a161a44ada46824e1731accd4a2f50934 /src
parent08acf63d7cc806c61c44b1cfdc125bbdcd0a8018 (diff)
downloadluaossl-b105f09ccc6ef4a90b97745f50a46a5910edcdc1.tar.gz
luaossl-b105f09ccc6ef4a90b97745f50a46a5910edcdc1.tar.bz2
luaossl-b105f09ccc6ef4a90b97745f50a46a5910edcdc1.zip
put EC variable declarations inside OPENSSL_NO_EC preprocessor guard (unable to confirm which, if any, of our platforms still don't support EC natively
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/openssl.c b/src/openssl.c
index c3f8bbb..dea175e 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -2511,10 +2511,7 @@ static int pk_toPEM(lua_State *L) {
static int pk_getParameters(lua_State *L) {
EVP_PKEY *key = checksimple(L, 1, PKEY_CLASS);
_Bool public_only = lua_toboolean(L, 2);
-
void *tmp;
- const EC_GROUP *group;
- const EC_POINT *public_key;
if (!(tmp = EVP_PKEY_get0(key)))
return auxL_error(L, auxL_EOPENSSL, "pkey:getParameters");
@@ -2590,7 +2587,11 @@ static int pk_getParameters(lua_State *L) {
lua_setfield(L, -2, "priv_key");
break;
- case EVP_PKEY_EC:
+#ifndef OPENSSL_NO_EC
+ case EVP_PKEY_EC: {
+ const EC_GROUP *group;
+ const EC_POINT *public_key;
+
/* pub_key */
if (!(group = EC_KEY_get0_group(tmp)) || !(public_key = EC_KEY_get0_public_key(tmp)))
return auxL_error(L, auxL_EOPENSSL, "pkey:getParameters");
@@ -2606,12 +2607,14 @@ static int pk_getParameters(lua_State *L) {
lua_setfield(L, -2, "priv_key");
break;
+ }
+#endif
default:
return luaL_error(L, "%d: unsupported EVP base type", EVP_PKEY_base_id(key));
} /* switch() */
return 1;
-}
+} /* pk_getParameters() */
static int pk__tostring(lua_State *L) {