aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-15 08:58:48 -0800
committerDoug Hogan <[email protected]>2019-01-15 08:58:48 -0800
commitf60984150457bbf3c600f8b241a49765a04b76c2 (patch)
tree8fa4e25e3ff9bc317a38d23d858f9f1b7ff80e51 /lib/crypto/c_src
parent7cb2e25a026e6d9ff2cdb078504163de5f71c29a (diff)
downloadotp-f60984150457bbf3c600f8b241a49765a04b76c2.tar.gz
otp-f60984150457bbf3c600f8b241a49765a04b76c2.tar.bz2
otp-f60984150457bbf3c600f8b241a49765a04b76c2.zip
When using DEBUG, avoid comparison of different signs
Diffstat (limited to 'lib/crypto/c_src')
-rw-r--r--lib/crypto/c_src/aes.c2
-rw-r--r--lib/crypto/c_src/chacha20.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/crypto/c_src/aes.c b/lib/crypto/c_src/aes.c
index 2df123e44e..2f30ec8a58 100644
--- a/lib/crypto/c_src/aes.c
+++ b/lib/crypto/c_src/aes.c
@@ -257,7 +257,7 @@ ERL_NIF_TERM aes_ctr_stream_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
if (EVP_CipherUpdate(new_ctx->ctx, out, &outl, data_bin.data, (int)data_bin.size) != 1)
goto err;
- ASSERT(outl == data_bin.size);
+ ASSERT(outl >= 0 && (size_t)outl == data_bin.size);
ret = enif_make_tuple2(env, enif_make_resource(env, new_ctx), cipher_term);
CONSUME_REDS(env,data_bin);
diff --git a/lib/crypto/c_src/chacha20.c b/lib/crypto/c_src/chacha20.c
index 5761383c95..cfcc395dca 100644
--- a/lib/crypto/c_src/chacha20.c
+++ b/lib/crypto/c_src/chacha20.c
@@ -101,7 +101,7 @@ ERL_NIF_TERM chacha20_stream_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
goto err;
if (EVP_CipherUpdate(new_ctx->ctx, out, &outl, data_bin.data, (int)data_bin.size) != 1)
goto err;
- ASSERT(outl == data_bin.size);
+ ASSERT(outl >= 0 && (size_t)outl == data_bin.size);
ret = enif_make_tuple2(env, enif_make_resource(env, new_ctx), cipher_term);
CONSUME_REDS(env, data_bin);