summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam <william@25tandclement.com>2014-07-17 16:24:57 -0700
committerwilliam <william@25tandclement.com>2014-07-17 16:24:57 -0700
commitf026c11953f5a3b3e7285a08829f5777cfe31331 (patch)
tree13bac56882ff5097e7a102817acbcfb8762ac9ce
parentb93223ff2e5a74f14431aa0fb09db55f0a96ecd9 (diff)
downloadluaossl-f026c11953f5a3b3e7285a08829f5777cfe31331.tar.gz
luaossl-f026c11953f5a3b3e7285a08829f5777cfe31331.tar.bz2
luaossl-f026c11953f5a3b3e7285a08829f5777cfe31331.zip
be more consistent about idiomatic 'return throwssl', patterned after 'return lua_error'
-rw-r--r--src/openssl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 0701642..76a409e 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -743,7 +743,7 @@ static int bn__tostring(lua_State *L) {
743 char *txt; 743 char *txt;
744 744
745 if (!(txt = BN_bn2dec(bn))) 745 if (!(txt = BN_bn2dec(bn)))
746 throwssl(L, "bignum:__tostring"); 746 return throwssl(L, "bignum:__tostring");
747 747
748 lua_pushstring(L, txt); 748 lua_pushstring(L, txt);
749 749
@@ -1202,7 +1202,7 @@ static int pk_toPEM(lua_State *L) {
1202 break; 1202 break;
1203 case 2: case 3: /* private, PrivateKey */ 1203 case 2: case 3: /* private, PrivateKey */
1204 if (!PEM_write_bio_PrivateKey(bio, key, 0, 0, 0, 0, 0)) 1204 if (!PEM_write_bio_PrivateKey(bio, key, 0, 0, 0, 0, 0))
1205 throwssl(L, "pkey:__tostring"); 1205 return throwssl(L, "pkey:__tostring");
1206 1206
1207 len = BIO_get_mem_data(bio, &pem); 1207 len = BIO_get_mem_data(bio, &pem);
1208 lua_pushlstring(L, pem, len); 1208 lua_pushlstring(L, pem, len);
@@ -2613,7 +2613,7 @@ static int xc_addExtension(lua_State *L) {
2613 X509_EXTENSION *ext = checksimple(L, 2, X509_EXT_CLASS); 2613 X509_EXTENSION *ext = checksimple(L, 2, X509_EXT_CLASS);
2614 2614
2615 if (!X509_add_ext(crt, ext, -1)) 2615 if (!X509_add_ext(crt, ext, -1))
2616 throwssl(L, "x509.cert:addExtension"); 2616 return throwssl(L, "x509.cert:addExtension");
2617 2617
2618 lua_pushboolean(L, 1); 2618 lua_pushboolean(L, 1);
2619 2619