From 926d819effb9f9e7bfb8c5172911c7a3951994ba Mon Sep 17 00:00:00 2001 From: William Ahern Date: Thu, 14 Mar 2013 10:50:44 -0700 Subject: -n allow NULL IV for, e.g., ECB mode --- openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v1.2.3-59-g8ed1b