huangcm
2025-02-24 69ed55dec4b2116a19e4cca4393cbc014fce5fb2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <inttypes.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
 
#include <hf_ssl_lib.h>
#include <libhfuzz/libhfuzz.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
int LLVMFuzzerInitialize(int* argc, char*** argv) {
    HFInit();
    HFResetRand();
 
    return 1;
}
 
int LLVMFuzzerTestOneInput(const uint8_t* buf, size_t len) {
    EVP_PKEY_free(d2i_AutoPrivateKey(NULL, &buf, len));
    return 0;
}
 
#ifdef __cplusplus
}
#endif