aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@server.local> 2013-03-14 10:50:44 -0700
committerLibravatarLibravatar William Ahern <william@server.local> 2013-03-14 10:50:44 -0700
commit926d819effb9f9e7bfb8c5172911c7a3951994ba (patch)
treea2e09b50bbb56f4a04beeb1705fc8e4e4db6a3d5
parent7a522eac64891902194e274991a460b9df2f338c (diff)
downloadluaossl-926d819effb9f9e7bfb8c5172911c7a3951994ba.tar.gz
luaossl-926d819effb9f9e7bfb8c5172911c7a3951994ba.tar.bz2
luaossl-926d819effb9f9e7bfb8c5172911c7a3951994ba.zip
-n
allow NULL IV for, e.g., ECB mode
-rw-r--r--openssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openssl.c b/openssl.c
index df2f744..119b56b 100644
--- a/openssl.c
+++ b/openssl.c
@@ -3571,7 +3571,7 @@ static int cipher_init(lua_State *L, _Bool encrypt) {
m = (size_t)EVP_CIPHER_CTX_key_length(ctx);
luaL_argcheck(L, 2, n == m, lua_pushfstring(L, "%u: invalid key length (should be %u)", (unsigned)n, (unsigned)m));
- iv = luaL_checklstring(L, 3, &n);
+ iv = luaL_optlstring(L, 3, NULL, &n);
m = (size_t)EVP_CIPHER_CTX_iv_length(ctx);
luaL_argcheck(L, 3, n == m, lua_pushfstring(L, "%u: invalid IV length (should be %u)", (unsigned)n, (unsigned)m));