Commit 56373596 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 83fe0f00
...@@ -75,7 +75,8 @@ $(TARGETS) : io.$(OBJEXT) ../libnettle.a ...@@ -75,7 +75,8 @@ $(TARGETS) : io.$(OBJEXT) ../libnettle.a
check: $(TS_ALL) check: $(TS_ALL)
LD_LIBRARY_PATH=../.lib srcdir="$(srcdir)" \ 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 Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && $(SHELL) ./config.status examples/$@ cd .. && $(SHELL) ./config.status examples/$@
......
...@@ -6,13 +6,13 @@ fi ...@@ -6,13 +6,13 @@ fi
data="$srcdir/nettle-benchmark.c" data="$srcdir/nettle-benchmark.c"
if [ -x rsa-encrypt ] ; then if [ -x rsa-encrypt$EXEEXT ] ; then
if ./rsa-encrypt -r rsa-decrypt testkey.pub < "$data" > testciphertext ; then if $EMULATOR ./rsa-encrypt -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then
: :
else else
exit 1 exit 1
fi fi
if ./rsa-decrypt testkey < testciphertext > testcleartext ; then if $EMULATOR ./rsa-decrypt testkey < testciphertext > testcleartext ; then
: :
else else
exit 1 exit 1
......
...@@ -6,8 +6,8 @@ fi ...@@ -6,8 +6,8 @@ fi
data="$srcdir/nettle-benchmark.c" data="$srcdir/nettle-benchmark.c"
if [ -x rsa-sign ] ; then if [ -x rsa-sign$EXEEXT ] ; then
if ./rsa-sign testkey < "$data" > testsignature ; then if $EMULATOR ./rsa-sign testkey < "$data" > testsignature ; then
exit 0; exit 0;
else else
exit 1 exit 1
......
...@@ -6,21 +6,21 @@ fi ...@@ -6,21 +6,21 @@ fi
data="$srcdir/nettle-benchmark.c" data="$srcdir/nettle-benchmark.c"
if [ -x rsa-verify ] ; then if [ -x rsa-verify$EXEEXT ] ; then
./rsa-sign testkey < "$data" > testsignature \ $EMULATOR ./rsa-sign testkey < "$data" > testsignature \
&& ./rsa-verify testkey.pub testsignature < "$data" \ && $EMULATOR ./rsa-verify testkey.pub testsignature < "$data" \
|| exit 1; || exit 1;
# Try modifying the data # Try modifying the data
sed s/128/129/ < "$data" >testdata 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 exit 1
fi fi
# Try modifying the signature # Try modifying the signature
sed s/1/2/ <testsignature > testsignature2 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; exit 1;
fi fi
exit 0 exit 0
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
set -e set -e
if [ -x rsa-keygen ] ; then if [ -x rsa-keygen$EXEEXT ] ; then
./rsa-keygen -r rsa-decrypt -o testkey || exit 1 $EMULATOR ./rsa-keygen -r rsa-decrypt$EXEEXT -o testkey || exit 1
fi fi
#! /bin/sh #! /bin/sh
rm -rf testkey testkey.pub testsignature testsignature2 testdata \ rm -rf testkey testkey.pub testsignature testsignature2 \
testdata testtmp \
testciphertext testcleartext 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