Work around another C language bug with empty spans.

This is another instance of
https://boringssl-review.googlesource.com/c/boringssl/+/38584. We missed
it because our UBSan bots only run on x86-64, which uses a different
version of this function.

See also https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=96307

Change-Id: Ib27eaca581c27fe9b7fd0e532d1a0e2850cb83d4
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/52125
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
fips-20220613
David Benjamin 3 years ago committed by Boringssl LUCI CQ
parent f94a7ce599
commit 4984e4a632
  1. 5
      crypto/poly1305/poly1305.c

@ -204,6 +204,11 @@ void CRYPTO_poly1305_update(poly1305_state *statep, const uint8_t *in,
size_t in_len) { size_t in_len) {
struct poly1305_state_st *state = poly1305_aligned_state(statep); struct poly1305_state_st *state = poly1305_aligned_state(statep);
// Work around a C language bug. See https://crbug.com/1019588.
if (in_len == 0) {
return;
}
#if defined(OPENSSL_POLY1305_NEON) #if defined(OPENSSL_POLY1305_NEON)
if (CRYPTO_is_NEON_capable()) { if (CRYPTO_is_NEON_capable()) {
CRYPTO_poly1305_update_neon(statep, in, in_len); CRYPTO_poly1305_update_neon(statep, in, in_len);

Loading…
Cancel
Save