From fcc89ded7f5cb5f81533883c30e7daa89195970d Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Thu, 28 Feb 2019 19:59:30 +0100 Subject: crypto: Remove condition of block size Unnecessary, because the underlying crypto libraries handles this case. Also: - Relax the condition of binary Key and IV -Fix bug for empty data on historic cryptolibs because tests fails for empty data on at least aes_cfb8 on OpenSSL 0.9.8h. It does not fail on OpenSSL 0.9.8zh. --- lib/crypto/c_src/api_ng.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib/crypto/c_src') diff --git a/lib/crypto/c_src/api_ng.c b/lib/crypto/c_src/api_ng.c index c4114d1626..f24aded748 100644 --- a/lib/crypto/c_src/api_ng.c +++ b/lib/crypto/c_src/api_ng.c @@ -165,8 +165,6 @@ ERL_NIF_TERM ng_crypto_update(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[ ASSERT(in_data_bin.size =< INT_MAX); block_size = EVP_CIPHER_CTX_block_size(ctx->ctx); - if (in_data_bin.size % (size_t)block_size != 0) - return ERROR_Str(env, "Data not a multiple of block size"); if (argc==3) { if (!enif_inspect_iolist_as_binary(env, argv[2], &ivec_bin)) -- cgit v1.2.3