diff options
author | William Ahern <william@server.local> | 2013-03-14 10:50:44 -0700 |
---|---|---|
committer | William Ahern <william@server.local> | 2013-03-14 10:50:44 -0700 |
commit | 926d819effb9f9e7bfb8c5172911c7a3951994ba (patch) | |
tree | a2e09b50bbb56f4a04beeb1705fc8e4e4db6a3d5 | |
parent | 7a522eac64891902194e274991a460b9df2f338c (diff) | |
download | luaossl-926d819effb9f9e7bfb8c5172911c7a3951994ba.tar.gz luaossl-926d819effb9f9e7bfb8c5172911c7a3951994ba.tar.bz2 luaossl-926d819effb9f9e7bfb8c5172911c7a3951994ba.zip |
-n
allow NULL IV for, e.g., ECB mode
-rw-r--r-- | openssl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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)); |