Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Sep 11, 2024
1 parent a5a33f0 commit 9ad4cad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions crypto/crypto_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,18 @@ TEST(CryptoTest, OPENSSL_hexstr2buf) {
// The longest test case we have is currently 4 bytes long
size_t expected_answer_len = OPENSSL_strnlen(test_case[1], 5);
unsigned char *buf = OPENSSL_hexstr2buf(test_value, &actual_answer_len);
ASSERT_TRUE(buf != nullptr);
EXPECT_EQ(expected_answer_len, actual_answer_len);
EXPECT_EQ(0, OPENSSL_memcmp(buf, expected_answer, expected_answer_len));
OPENSSL_free(buf);
}

// Test failure modes
size_t actual_answer_len = 0;
EXPECT_FALSE(OPENSSL_hexstr2buf("a", &actual_answer_len));
EXPECT_FALSE(OPENSSL_hexstr2buf(NULL, &actual_answer_len));
EXPECT_FALSE(OPENSSL_hexstr2buf("ab", nullptr));
EXPECT_FALSE(OPENSSL_hexstr2buf("ag", &actual_answer_len));
}

#if defined(BORINGSSL_FIPS_COUNTERS)
Expand Down
2 changes: 1 addition & 1 deletion crypto/evp_extra/p_x25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const EVP_PKEY_METHOD x25519_pkey_meth = {
pkey_x25519_derive,
NULL /* paramgen */,
pkey_x25519_ctrl,
NULL,
NULL, /* ctrl_str */
NULL /* keygen deterministic */,
NULL /* encapsulate deterministic */,
NULL /* encapsulate */,
Expand Down

0 comments on commit 9ad4cad

Please sign in to comment.