# HG changeset patch # User Myhailo Danylenko # Date 1457185872 -7200 # Node ID d92358eafeade165274eced4ba9393523a8f6b91 # Parent 745b73f916076a079077aac6acce1e4087833c05 ssl: Return object from cipher/ca methods for chain initialization diff -r 745b73f91607 -r d92358eafead CMakeLists.txt --- a/CMakeLists.txt Sat Mar 05 15:45:33 2016 +0200 +++ b/CMakeLists.txt Sat Mar 05 15:51:12 2016 +0200 @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 2.6) project(lua-lm C) -set(PROJECT_VERSION "0.9.4") +set(PROJECT_VERSION "0.9.5") ## User options option(DEBUG "Enable debugging output" OFF) diff -r 745b73f91607 -r d92358eafead docs/api.mdwn --- a/docs/api.mdwn Sat Mar 05 15:45:33 2016 +0200 +++ b/docs/api.mdwn Sat Mar 05 15:51:12 2016 +0200 @@ -522,13 +522,15 @@ ### ssl:ca_path Set path to trusted ssl certificates. Argument must be a name of a PEM file or a name of directory with hashed certificates. -**Arguments:** string (path) +**Arguments:** string (path) +**Return values:** [lm ssl](#lm.ssl) object ### ssl:cipher_list Set list of allowed ciphers (colon-separated). Names may vary depending on ssl implementation in use. -**Arguments:** string (cipher list) +**Arguments:** string (cipher list) +**Return values:** [lm ssl](#lm.ssl) object ### ssl:fingerprint diff -r 745b73f91607 -r d92358eafead lm_ssl.c --- a/lm_ssl.c Sat Mar 05 15:45:33 2016 +0200 +++ b/lm_ssl.c Sat Mar 05 15:51:12 2016 +0200 @@ -172,12 +172,14 @@ /// Set path to trusted ssl certificates. Argument must be a name of a PEM file /// or a name of directory with hashed certificates. /// A: string (path) +/// R: lm ssl object static int ca_path_lm_ssl (lua_State *L) { llm_ssl_t *object = luaL_checklm_ssl (L, 1); const gchar *path = luaL_checkstring (L, 2); lm_ssl_set_ca (object -> ssl, path); - return 0; + lua_pop (L, 1); + return 1; } #endif @@ -186,12 +188,14 @@ /// Set list of allowed ciphers (colon-separated). Names may vary depending on ssl /// implementation in use. /// A: string (cipher list) +/// R: lm ssl object static int cipher_list_lm_ssl (lua_State *L) { llm_ssl_t *object = luaL_checklm_ssl (L, 1); const gchar *list = luaL_checkstring (L, 2); lm_ssl_set_cipher_list (object -> ssl, list); - return 0; + lua_pop (L, 1); + return 1; } #endif