From 5694b3a84b16e7a065566816da51e056246d98e6 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Mon, 11 May 2015 23:26:40 -0400 Subject: [PATCH] Fix invalid assert in CRYPTO_ctr128_encrypt. As with CRYPTO_ctr128_encrypt_ctr32, NULL in and out are legal in the degenerate case when len is 0. This fixes one of the two failures on the bots. Change-Id: If6016dfc3963d9c06c849fc8eba9908556f66666 Reviewed-on: https://boringssl-review.googlesource.com/4721 Reviewed-by: Adam Langley --- crypto/modes/ctr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/modes/ctr.c b/crypto/modes/ctr.c index 306b6f74..64062b27 100644 --- a/crypto/modes/ctr.c +++ b/crypto/modes/ctr.c @@ -88,7 +88,8 @@ void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, block128_f block) { unsigned int n; - assert(in && out && key && ecount_buf && num); + assert(key && ecount_buf && num); + assert(len == 0 || (in && out)); assert(*num < 16); assert((16 % sizeof(size_t)) == 0);