summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Ahern <william@25thandClement.com>2015-12-18 14:08:28 +0800
committerWilliam Ahern <william@25thandClement.com>2015-12-18 14:08:28 +0800
commitb105f09ccc6ef4a90b97745f50a46a5910edcdc1 (patch)
treec05c926a161a44ada46824e1731accd4a2f50934
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
-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) {
2511static int pk_getParameters(lua_State *L) { 2511static int pk_getParameters(lua_State *L) {
2512 EVP_PKEY *key = checksimple(L, 1, PKEY_CLASS); 2512 EVP_PKEY *key = checksimple(L, 1, PKEY_CLASS);
2513 _Bool public_only = lua_toboolean(L, 2); 2513 _Bool public_only = lua_toboolean(L, 2);
2514
2515 void *tmp; 2514 void *tmp;
2516 const EC_GROUP *group;
2517 const EC_POINT *public_key;
2518 2515
2519 if (!(tmp = EVP_PKEY_get0(key))) 2516 if (!(tmp = EVP_PKEY_get0(key)))
2520 return auxL_error(L, auxL_EOPENSSL, "pkey:getParameters"); 2517 return auxL_error(L, auxL_EOPENSSL, "pkey:getParameters");
@@ -2590,7 +2587,11 @@ static int pk_getParameters(lua_State *L) {
2590 lua_setfield(L, -2, "priv_key"); 2587 lua_setfield(L, -2, "priv_key");
2591 2588
2592 break; 2589 break;
2593 case EVP_PKEY_EC: 2590#ifndef OPENSSL_NO_EC
2591 case EVP_PKEY_EC: {
2592 const EC_GROUP *group;
2593 const EC_POINT *public_key;
2594
2594 /* pub_key */ 2595 /* pub_key */
2595 if (!(group = EC_KEY_get0_group(tmp)) || !(public_key = EC_KEY_get0_public_key(tmp))) 2596 if (!(group = EC_KEY_get0_group(tmp)) || !(public_key = EC_KEY_get0_public_key(tmp)))
2596 return auxL_error(L, auxL_EOPENSSL, "pkey:getParameters"); 2597 return auxL_error(L, auxL_EOPENSSL, "pkey:getParameters");
@@ -2606,12 +2607,14 @@ static int pk_getParameters(lua_State *L) {
2606 lua_setfield(L, -2, "priv_key"); 2607 lua_setfield(L, -2, "priv_key");
2607 2608
2608 break; 2609 break;
2610 }
2611#endif
2609 default: 2612 default:
2610 return luaL_error(L, "%d: unsupported EVP base type", EVP_PKEY_base_id(key)); 2613 return luaL_error(L, "%d: unsupported EVP base type", EVP_PKEY_base_id(key));
2611 } /* switch() */ 2614 } /* switch() */
2612 2615
2613 return 1; 2616 return 1;
2614} 2617} /* pk_getParameters() */
2615 2618
2616 2619
2617static int pk__tostring(lua_State *L) { 2620static int pk__tostring(lua_State *L) {