summaryrefslogtreecommitdiffstats
path: root/regress/misc/fuzz-harness/privkey_fuzz.cc
blob: ff0b0f7769dc80b4c3109dc839996128d9fa63ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>

extern "C" {

#include "sshkey.h"
#include "sshbuf.h"

int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
	struct sshkey *k = NULL;
	struct sshbuf *b = sshbuf_from(data, size);
	int r = sshkey_private_deserialize(b, &k);
	if (r == 0) sshkey_free(k);
	sshbuf_free(b);
	return 0;
}

} // extern