Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstewart committed Jul 11, 2024
1 parent 3f07e41 commit 9f2f67f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/unstable/fingerprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ S2N_API int s2n_fingerprint_get_raw_size(const struct s2n_fingerprint *fingerpri
* @param fingerprint The s2n_fingerprint to be used for the raw string
* @param max_output_size The maximum size of data that may be written to `output`.
* If `output` is too small, an S2N_ERR_T_USAGE error will occur.
* @param output The location that the requested hash will be written to.
* @param output The location that the requested raw string will be written to.
* @param output_size Output variable to be set to the actual size of the data
* written to `output`.
* @returns S2N_SUCCESS on success, S2N_FAILURE on failure.
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/s2n_fingerprint_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ int main(int argc, char **argv)

/* Test s2n_fingerprint_new / s2n_fingerprint_free */
{
/* New fails for an invalid handshake method */
/* New fails for an invalid fingerprint method */
EXPECT_NULL_WITH_ERRNO(s2n_fingerprint_new(-1), S2N_ERR_INVALID_ARGUMENT);

/* Free is a no-op for a NULL pointer */
EXPECT_SUCCESS(s2n_fingerprint_free(NULL));

/* New succeeds for a valid handshake method */
/* New succeeds for a valid fingerprint method */
struct s2n_fingerprint *fingerprint = s2n_fingerprint_new(S2N_FINGERPRINT_JA3);
EXPECT_NOT_NULL(fingerprint);
EXPECT_EQUAL(fingerprint->method, &ja3_fingerprint);
Expand All @@ -311,15 +311,15 @@ int main(int argc, char **argv)
struct s2n_fingerprint fingerprint = { 0 };
EXPECT_NOT_NULL(memset(&fingerprint, 1, sizeof(struct s2n_fingerprint)));
EXPECT_NOT_NULL(fingerprint.method);
EXPECT_TRUE(s2n_hash_is_ready_for_input(&fingerprint.hash));
EXPECT_TRUE(fingerprint.hash.is_ready_for_input);
EXPECT_NOT_NULL(fingerprint.client_hello);
EXPECT_TRUE(fingerprint.legacy_hash_format);
EXPECT_NOT_EQUAL(fingerprint.raw_size, 0);

/* Verify that wipe only clears the expected fields */
EXPECT_SUCCESS(s2n_fingerprint_wipe(&fingerprint));
EXPECT_NOT_NULL(fingerprint.method);
EXPECT_TRUE(s2n_hash_is_ready_for_input(&fingerprint.hash));
EXPECT_TRUE(fingerprint.hash.is_ready_for_input);
EXPECT_NULL(fingerprint.client_hello);
EXPECT_TRUE(fingerprint.legacy_hash_format);
EXPECT_EQUAL(fingerprint.raw_size, 0);
Expand Down

0 comments on commit 9f2f67f

Please sign in to comment.