You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
489 B
30 lines
489 B
#include <stddef.h>
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
extern "C" {
|
|
|
|
#include "sshsig.h"
|
|
|
|
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
|
{
|
|
char *cp = (char *)malloc(size + 1);
|
|
struct sshsigopt *opts = NULL;
|
|
|
|
if (cp == NULL)
|
|
goto out;
|
|
memcpy(cp, data, size);
|
|
cp[size] = '\0';
|
|
if ((opts = sshsigopt_parse(cp, "libfuzzer", 0, NULL)) == NULL)
|
|
goto out;
|
|
|
|
out:
|
|
free(cp);
|
|
sshsigopt_free(opts);
|
|
return 0;
|
|
}
|
|
|
|
} // extern "C"
|