Skip to content

Commit

Permalink
fuzz test: Allow aws signing filter to run. (envoyproxy#21163)
Browse files Browse the repository at this point in the history
* fuzz test: Allow aws signing filter to run.

Provide decoding_buffer_ to aws signing filter, allowing it to run
further.

Signed-off-by: Andre Vehreschild <vehre@x41-dsec.de>
  • Loading branch information
vehre-x41 authored May 5, 2022
1 parent e6dc83b commit 697db5f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/extensions/filters/http/common/fuzz/uber_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class UberFilterFuzzer : public HttpFilterFuzzer {
// Mocked callbacks.
NiceMock<Http::MockStreamDecoderFilterCallbacks> decoder_callbacks_;
NiceMock<Http::MockStreamEncoderFilterCallbacks> encoder_callbacks_;

const Buffer::Instance* decoding_buffer_{};
};

} // namespace HttpFilters
Expand Down
7 changes: 7 additions & 0 deletions test/extensions/filters/http/common/fuzz/uber_per_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ void UberFilterFuzzer::perFilterSetup() {
.WillByDefault(testing::ReturnRef(listener_metadata_));
ON_CALL(factory_context_.api_, customStatNamespaces())
.WillByDefault(testing::ReturnRef(custom_stat_namespaces_));

// Prepare expectations for AWSRequestSigning filter
ON_CALL(decoder_callbacks_, addDecodedData(_, _))
.WillByDefault([this](Buffer::Instance& data, bool) { decoding_buffer_ = &data; });
ON_CALL(decoder_callbacks_, decodingBuffer()).WillByDefault([this]() -> const Buffer::Instance* {
return decoding_buffer_;
});
}

} // namespace HttpFilters
Expand Down

0 comments on commit 697db5f

Please sign in to comment.