Clean up fuzz helper classes

- Remove OEMCrypto state changes hidden in constructors and destructors.
- Use composition instead of inheritance to structure classes.
- Avoid calling non-trivial destructors for objects with static
  lifetime.

Merged from https://widevine-internal-review.googlesource.com/168497
Merged from https://widevine-internal-review.googlesource.com/171170
Merged from https://widevine-internal-review.googlesource.com/171171
Merged from https://widevine-internal-review.googlesource.com/171870

Change-Id: I20476a7b1132d11f011b8650ec01e3c2dc3fc0e8
This commit is contained in:
Ian Benz
2023-03-20 17:46:15 +00:00
committed by Robert Shih
parent af070601b0
commit 53fe55cb72
30 changed files with 518 additions and 398 deletions

View File

@@ -3,7 +3,7 @@
#include "opk_dispatcher.h"
#include "opk_init.h"
namespace wvoec {
namespace {
void OpenOEMCryptoTASession() {
uint8_t request_body[] = {
@@ -35,6 +35,8 @@ void InitializeOEMCryptoTA() {
OPK_DispatchMessage(&request, &response);
}
} // namespace
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
OPK_Initialize();
InitializeOEMCryptoTA();
@@ -51,5 +53,3 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
OPK_DispatchMessage(&request, &response);
return 0;
}
} // namespace wvoec