Commit adde2bba authored by Martin Storsjö's avatar Martin Storsjö Committed by Niels Möller

* examples/Makefile.in (check): Pass $(EMULATOR) and $(EXEEXT) in

the environment of run-tests.
* examples/rsa-encrypt-test: Use $EXEEXT and $EMULATOR.
* examples/rsa-sign-test: Likewise.
* examples/rsa-verify-test: Likewise.
* examples/setup-env: Likewise.

Rev: nettle/examples/Makefile.in:1.10
Rev: nettle/examples/rsa-encrypt-test:1.2
Rev: nettle/examples/rsa-sign-test:1.2
Rev: nettle/examples/rsa-verify-test:1.2
Rev: nettle/examples/setup-env:1.2
Rev: nettle/examples/teardown-env:1.2
parent 9cd3c96e
......@@ -75,7 +75,8 @@ $(TARGETS) : io.$(OBJEXT) ../libnettle.a
check: $(TS_ALL)
LD_LIBRARY_PATH=../.lib srcdir="$(srcdir)" \
"$(srcdir)"/run-tests $(TS_ALL)
EMULATOR="$(EMULATOR)" EXEEXT="$(EXEEXT)" \
"$(srcdir)"/run-tests $(TS_ALL)
Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && $(SHELL) ./config.status examples/$@
......
......@@ -6,13 +6,13 @@ fi
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-encrypt ] ; then
if ./rsa-encrypt -r rsa-decrypt testkey.pub < "$data" > testciphertext ; then
if [ -x rsa-encrypt$EXEEXT ] ; then
if $EMULATOR ./rsa-encrypt -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then
:
else
exit 1
fi
if ./rsa-decrypt testkey < testciphertext > testcleartext ; then
if $EMULATOR ./rsa-decrypt testkey < testciphertext > testcleartext ; then
:
else
exit 1
......
......@@ -6,8 +6,8 @@ fi
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-sign ] ; then
if ./rsa-sign testkey < "$data" > testsignature ; then
if [ -x rsa-sign$EXEEXT ] ; then
if $EMULATOR ./rsa-sign testkey < "$data" > testsignature ; then
exit 0;
else
exit 1
......
......@@ -6,21 +6,21 @@ fi
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-verify ] ; then
./rsa-sign testkey < "$data" > testsignature \
&& ./rsa-verify testkey.pub testsignature < "$data" \
if [ -x rsa-verify$EXEEXT ] ; then
$EMULATOR ./rsa-sign testkey < "$data" > testsignature \
&& $EMULATOR ./rsa-verify testkey.pub testsignature < "$data" \
|| exit 1;
# Try modifying the data
sed s/128/129/ < "$data" >testdata
if ./rsa-verify testkey.pub testsignature < testdata 2>/dev/null; then
if $EMULATOR ./rsa-verify testkey.pub testsignature < testdata 2>/dev/null; then
exit 1
fi
# Try modifying the signature
sed s/1/2/ <testsignature > testsignature2
if ./rsa-verify testkey.pub testsignature2 < "$data" 2>/dev/null; then
if $EMULATOR ./rsa-verify testkey.pub testsignature2 < "$data" 2>/dev/null; then
exit 1;
fi
exit 0
......
......@@ -2,6 +2,6 @@
set -e
if [ -x rsa-keygen ] ; then
./rsa-keygen -r rsa-decrypt -o testkey || exit 1
if [ -x rsa-keygen$EXEEXT ] ; then
$EMULATOR ./rsa-keygen -r rsa-decrypt$EXEEXT -o testkey || exit 1
fi
#! /bin/sh
rm -rf testkey testkey.pub testsignature testsignature2 testdata \
rm -rf testkey testkey.pub testsignature testsignature2 \
testdata testtmp \
testciphertext testcleartext
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment