Skip to content

Commit

Permalink
Silence some clang warnings on macOS and iOS CQ bots.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
davidben authored and agl committed Sep 25, 2020
1 parent e0900ac commit b13e7b5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crypto/hpke/hpke_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,8 @@ TEST(HPKETest, SenderInvalidOpen) {
// are empty.
TEST(HPKETest, EmptyPSK) {
const uint8_t kMockEnc[X25519_PUBLIC_VALUE_LEN] = {0xff};
const uint8_t kMockPSK[100] = {0xff};
const bssl::Span<const uint8_t> kPSKValues[] = {
{kMockPSK, sizeof(kMockPSK)},
{nullptr, 0},
};
const std::vector<uint8_t> kPSKValues[] = {std::vector<uint8_t>(100, 0xff),
{}};

// Generate the receiver's keypair.
uint8_t secret_key_r[X25519_PRIVATE_KEY_LEN];
Expand All @@ -427,8 +424,8 @@ TEST(HPKETest, EmptyPSK) {
// Vary the PSK and PSKID inputs for the sender and receiver, trying all four
// permutations of empty and nonempty inputs.

for (const auto psk : kPSKValues) {
for (const auto psk_id : kPSKValues) {
for (const auto &psk : kPSKValues) {
for (const auto &psk_id : kPSKValues) {
const bool kExpectSuccess = psk.size() > 0 && psk_id.size() > 0;

ASSERT_EQ(ERR_get_error(), 0u);
Expand Down

0 comments on commit b13e7b5

Please sign in to comment.