Silence some clang warnings on macOS and iOS CQ bots.

Looks like some toolchain updated recently and the bots are complaining
about copy vs reference. While I'm here, this is a test and just
declaring a pair of vectors is much less typing than an external array
and a pair of spans.

Change-Id: Iffc0beed99f5ef492d78bc58b5bb02d7c595a072
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/43044
Reviewed-by: Adam Langley <agl@google.com>
chromium-5359
David Benjamin 5 years ago committed by Adam Langley
parent e0900ac5e1
commit b13e7b5fdc
  1. 11
      crypto/hpke/hpke_test.cc

@ -413,11 +413,8 @@ TEST(HPKETest, SenderInvalidOpen) {
// are empty. // are empty.
TEST(HPKETest, EmptyPSK) { TEST(HPKETest, EmptyPSK) {
const uint8_t kMockEnc[X25519_PUBLIC_VALUE_LEN] = {0xff}; const uint8_t kMockEnc[X25519_PUBLIC_VALUE_LEN] = {0xff};
const uint8_t kMockPSK[100] = {0xff}; const std::vector<uint8_t> kPSKValues[] = {std::vector<uint8_t>(100, 0xff),
const bssl::Span<const uint8_t> kPSKValues[] = { {}};
{kMockPSK, sizeof(kMockPSK)},
{nullptr, 0},
};
// Generate the receiver's keypair. // Generate the receiver's keypair.
uint8_t secret_key_r[X25519_PRIVATE_KEY_LEN]; uint8_t secret_key_r[X25519_PRIVATE_KEY_LEN];
@ -427,8 +424,8 @@ TEST(HPKETest, EmptyPSK) {
// Vary the PSK and PSKID inputs for the sender and receiver, trying all four // Vary the PSK and PSKID inputs for the sender and receiver, trying all four
// permutations of empty and nonempty inputs. // permutations of empty and nonempty inputs.
for (const auto psk : kPSKValues) { for (const auto &psk : kPSKValues) {
for (const auto psk_id : kPSKValues) { for (const auto &psk_id : kPSKValues) {
const bool kExpectSuccess = psk.size() > 0 && psk_id.size() > 0; const bool kExpectSuccess = psk.size() > 0 && psk_id.size() > 0;
ASSERT_EQ(ERR_get_error(), 0u); ASSERT_EQ(ERR_get_error(), 0u);

Loading…
Cancel
Save