ssl: Return object from cipher/ca methods for chain initialization
authorMyhailo Danylenko <isbear@ukrpost.net>
Sat, 05 Mar 2016 15:51:12 +0200
changeset 62 d92358eafead
parent 61 745b73f91607
child 63 c17f3295f52c
ssl: Return object from cipher/ca methods for chain initialization
CMakeLists.txt
docs/api.mdwn
lm_ssl.c
--- 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)
--- 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  
 
 <a name="ssl:cipher.list"></a>
 ### 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  
 
 <a name="ssl:fingerprint"></a>
 ### ssl:fingerprint
--- 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