+2024-06-16 Niels Möller <nisse@lysator.liu.se>
+
+ * examples/rsa-encrypt-test: Consistently add $EXEEXT to
+ executable names.
+ * examples/rsa-sign-test: Likewise.
+ * examples/rsa-verify-test: Likewise.
+ * examples/setup-env: Likewise.
+ * tools/nettle-pbkdf2-test: Likewise.
+ * tools/pkcs1-conv-test: Likewise
+ * tools/sexp-conv-test: Likewise.
+
+ * configure.ac: When cross-compiling targetting windows,
+ always use "wine" as EMULATOR; using "wine64" for 64-bit windows
+ seems no longer needed.
+
2024-06-15 Niels Möller <nisse@lysator.liu.se>
* testsuite/Makefile.in (TS_SC_NETTLE): New variable.
;;
esac
if test "x$cross_compiling" = xyes ; then
- case "$ABI" in
- 64)
- EMULATOR=wine64
- ;;
- *)
- EMULATOR=wine
- ;;
- esac
+ EMULATOR=wine
fi
if test "x$ABI" = x64 ; then
W64_ABI=yes
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-encrypt$EXEEXT ] ; then
- if $EMULATOR ./rsa-encrypt -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then
+ if $EMULATOR ./rsa-encrypt$EXEEXT -r rsa-decrypt$EXEEXT testkey.pub < "$data" > testciphertext ; then
:
else
exit 1
fi
- if $EMULATOR ./rsa-decrypt testkey < testciphertext > testcleartext ; then
+ if $EMULATOR ./rsa-decrypt$EXEEXT testkey < testciphertext > testcleartext ; then
:
else
exit 1
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-sign$EXEEXT ] ; then
- if $EMULATOR ./rsa-sign testkey < "$data" > testsignature ; then
+ if $EMULATOR ./rsa-sign$EXEEXT testkey < "$data" > testsignature ; then
exit 0;
else
exit 1
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-verify$EXEEXT ] ; then
- $EMULATOR ./rsa-sign testkey < "$data" > testsignature \
- && $EMULATOR ./rsa-verify testkey.pub testsignature < "$data" \
+ $EMULATOR ./rsa-sign$EXEEXT testkey < "$data" > testsignature \
+ && $EMULATOR ./rsa-verify$EXEEXT testkey.pub testsignature < "$data" \
|| exit 1;
# Try modifying the data
sed s/128/129/ < "$data" >testdata
- if $EMULATOR ./rsa-verify testkey.pub testsignature < testdata 2>/dev/null; then
+ if $EMULATOR ./rsa-verify$EXEEXT testkey.pub testsignature < testdata 2>/dev/null; then
exit 1
fi
# Try modifying the signature
sed s/1/2/ <testsignature > testsignature2
- if $EMULATOR ./rsa-verify testkey.pub testsignature2 < "$data" 2>/dev/null; then
+ if $EMULATOR ./rsa-verify$EXEEXT testkey.pub testsignature2 < "$data" 2>/dev/null; then
exit 1;
fi
exit 0
set -e
if [ -x rsa-keygen$EXEEXT ] ; then
- $EMULATOR ./rsa-keygen -r rsa-decrypt$EXEEXT -o testkey || exit 1
+ $EMULATOR ./rsa-keygen$EXEEXT -r rsa-decrypt$EXEEXT -o testkey || exit 1
fi
# Delete carriage return characters, needed when testing with
# wine.
- printf "%s" "$password" | $EMULATOR ./nettle-pbkdf2 \
+ printf "%s" "$password" | $EMULATOR ./nettle-pbkdf2$EXEEXT \
-i "$iters" -l "$length" "$salt" | tr -d '\r' > test1.out
echo "$expected" | tr -d '\r' > test2.out
[ -x ./pkcs1-conv$EXEEXT ] || exit 77
# Private RSA key, generated by openssl
-$EMULATOR ./pkcs1-conv >testkey.priv <<EOF || exit 1
+$EMULATOR ./pkcs1-conv$EXEEXT >testkey.priv <<EOF || exit 1
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQC3792bBgQ/mc8aYOFaLEJES/JipmLAeVgznob/Vrzvdcx+bl6L
6gTphctU9ToOLC049dZYW3DJ53owUmbQgqB0vvLTjM9lGSEw4oXLrp7x/XVo/fZM
-----END RSA PRIVATE KEY-----
EOF
-$EMULATOR ./pkcs1-conv >testkey.pub <<EOF || exit 1
+$EMULATOR ./pkcs1-conv$EXEEXT >testkey.pub <<EOF || exit 1
# Corresponding public key
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3792bBgQ/mc8aYOFaLEJES/Ji
-----END PUBLIC KEY-----
EOF
-$EMULATOR ../examples/rsa-sign testkey.priv >testtmp <<EOF || exit 1
+$EMULATOR ../examples/rsa-sign$EXEEXT testkey.priv >testtmp <<EOF || exit 1
gazonk
EOF
tr -d '\r' < testtmp > testsignature
5c96ffe7e925224ce6e98648bf2ed3193cab2fc82af9c7fa7fdc5b623bde1d77c5409129d16d1127ae4fad519c24059fe85f4a4360a900f3dee906e6de2ecd010fa56c02d3f7d0772d43439464a91b025722a6f0b6cb65aee1017b29aff4511f90315caae0be74c2ac496474896e7e3ad200cb7c609ddef5c674272964e4b780
EOF
-$EMULATOR ../examples/rsa-verify testkey.pub testsignature <<EOF || exit 1
+$EMULATOR ../examples/rsa-verify$EXEEXT testkey.pub testsignature <<EOF || exit 1
gazonk
EOF
test_advanced () {
print_raw "$1" test.in
- if $EMULATOR ./sexp-conv -s advanced <test.in | tr -d '\r' >test1.out ; then
+ if $EMULATOR ./sexp-conv$EXEEXT -s advanced <test.in | tr -d '\r' >test1.out ; then
true
else
exit 1
test_advanced_hex () {
print_raw "$1" test.in
- if $EMULATOR ./sexp-conv -s hex <test.in | tr -d '\r' >test1.out ; then
+ if $EMULATOR ./sexp-conv$EXEEXT -s hex <test.in | tr -d '\r' >test1.out ; then
true
else
exit 1
test_transport () {
print_raw "$1" test.in
- if $EMULATOR ./sexp-conv -s transport <test.in | tr -d '\r' >test1.out ; then
+ if $EMULATOR ./sexp-conv$EXEEXT -s transport <test.in | tr -d '\r' >test1.out ; then
true
else
exit 1
test_canonical () {
print_raw "$1" test.in
- if $EMULATOR ./sexp-conv -s canonical <test.in >test1.out ; then
+ if $EMULATOR ./sexp-conv$EXEEXT -s canonical <test.in >test1.out ; then
true
else
exit 1