Skip to content

Commit

Permalink
Remove unused inject_hash_no_write parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Aug 23, 2024
1 parent 6f8eeb1 commit 3a234cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion util/fipstools/inject_hash/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ extern "C"
fprintf(stderr, "\n"); \
} while(0)

int inject_hash_no_write(const char *ar_input, const char *o_input, const char *out_path, int apple_flag, uint8_t **object_bytes, size_t *object_bytes_size);
int inject_hash_no_write(const char *ar_input, const char *o_input,
int apple_flag, uint8_t **object_bytes,
size_t *object_bytes_size);
int inject_hash(int argc, char *argv[]);

#ifdef __cplusplus
Expand Down
7 changes: 5 additions & 2 deletions util/fipstools/inject_hash/inject_hash_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ static int do_apple(const char *object_file, uint8_t **text_module, size_t *text
return ret;
}

int inject_hash_no_write(const char *ar_input, const char *o_input, const char *out_path, int apple_flag, uint8_t **object_bytes, size_t *object_bytes_size) {
int inject_hash_no_write(const char *ar_input, const char *o_input,
int apple_flag, uint8_t **object_bytes,
size_t *object_bytes_size) {
int ret = 0;

uint8_t uninit_hash[] = {
Expand Down Expand Up @@ -339,7 +341,8 @@ int inject_hash(int argc, char *argv[]) {
goto end;
}

if (!inject_hash_no_write(ar_input, o_input, out_path, apple_flag, &object_bytes, &object_bytes_size)) {
if (!inject_hash_no_write(ar_input, o_input, apple_flag, &object_bytes,
&object_bytes_size)) {
LOG_ERROR("Error encountered while injecting hash");
goto end;
}
Expand Down
8 changes: 5 additions & 3 deletions util/fipstools/inject_hash/tests/inject_hash_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEST_F(InjectHashTestFixture, TestGoodLib) {

uint8_t *object_bytes_ptr = object_bytes.get();

ASSERT_EQ(1, inject_hash_no_write(NULL, good_lib_filename.c_str(), good_lib_filename.c_str(), 1, &object_bytes_ptr, &object_bytes_size));
ASSERT_EQ(1, inject_hash_no_write(NULL, good_lib_filename.c_str(), 1, &object_bytes_ptr, &object_bytes_size));
}

TEST_F(InjectHashTestFixture, TestBadHashLib) {
Expand All @@ -39,7 +39,8 @@ TEST_F(InjectHashTestFixture, TestBadHashLib) {
int inject_hash_ret;
testing::internal::CaptureStderr();

inject_hash_ret = inject_hash_no_write(NULL, bad_hash_lib_filename.c_str(), bad_hash_lib_filename.c_str(), 1, &object_bytes_ptr, &object_bytes_size);
inject_hash_ret = inject_hash_no_write(NULL, bad_hash_lib_filename.c_str(), 1,
&object_bytes_ptr, &object_bytes_size);
std::string captured_stderr = testing::internal::GetCapturedStderr();

ASSERT_EQ(0, inject_hash_ret);
Expand All @@ -55,7 +56,8 @@ TEST_F(InjectHashTestFixture, TestBadMarkerLib) {
int inject_hash_ret;
testing::internal::CaptureStderr();

inject_hash_ret = inject_hash_no_write(NULL, bad_marker_lib_filename.c_str(), bad_marker_lib_filename.c_str(), 1, &object_bytes_ptr, &object_bytes_size);
inject_hash_ret = inject_hash_no_write(NULL, bad_marker_lib_filename.c_str(), 1,
&object_bytes_ptr, &object_bytes_size);
std::string captured_stderr = testing::internal::GetCapturedStderr();

ASSERT_EQ(0, inject_hash_ret);
Expand Down

0 comments on commit 3a234cc

Please sign in to comment.