2020-12-22 16:01:26 +03:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2023-05-16 00:08:13 +03:00
|
|
|
#include <freerdp/crypto/certificate_store.h>
|
2020-12-22 16:01:26 +03:00
|
|
|
|
|
|
|
int LLVMFuzzerTestOneInput(const uint8_t* Data, size_t Size)
|
|
|
|
{
|
2023-05-31 14:35:58 +03:00
|
|
|
rdpCertificateData* data = NULL;
|
2023-05-16 00:08:13 +03:00
|
|
|
char* pem = calloc(Size + 1, sizeof(char));
|
|
|
|
if (pem == NULL)
|
2020-12-22 16:01:26 +03:00
|
|
|
goto cleanup;
|
2023-05-16 00:08:13 +03:00
|
|
|
memcpy(pem, Data, Size);
|
2020-12-22 16:01:26 +03:00
|
|
|
|
2023-05-16 00:08:13 +03:00
|
|
|
data = freerdp_certificate_data_new_from_pem("somehost", 1234, pem, Size);
|
|
|
|
if (!data)
|
2020-12-22 16:01:26 +03:00
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
cleanup:
|
2023-05-16 00:08:13 +03:00
|
|
|
freerdp_certificate_data_free(data);
|
|
|
|
free(pem);
|
2020-12-22 16:01:26 +03:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|