summaryrefslogtreecommitdiff
path: root/fuzz/harnesses/assert-rsa-h-p
blob: 8eb9ea6a6071227483a9a7bdab4ee152b2561301 (plain)
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
28
29
30
31
32
33
#!/bin/bash -u
# Copyright (c) 2019 Yubico AB. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

T=assert-rsa-h-p

sync() {
	mkdir ${T}
	ssh "${REMOTE}" "cd ${T}/afl-out && tar -cf- queue ../pubkey ../hmac-salt" | \
		tar -C ${T} -xf-
}

run() {
	find ${T}/queue -type f | while read f; do
		cat "${f}" | LD_PRELOAD=${PRELOAD} build/examples/assert \
			-t rsa -h ${T}/hmac-out -s ${T}/hmac-salt \
			-p ${T}/pubkey nodev 2>/dev/null 1>&2
	done
}

case "$1" in
sync)
	sync
	;;
run)
	run
	exit 0
	;;
*)
	echo unknown command "$1"
	exit 1
esac