]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Fixes for running tests in wine. nettle_3.10_release_20240616
authorNiels Möller <nisse@lysator.liu.se>
Sun, 16 Jun 2024 10:51:17 +0000 (12:51 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Sun, 16 Jun 2024 10:51:17 +0000 (12:51 +0200)
ChangeLog
configure.ac
examples/rsa-encrypt-test
examples/rsa-sign-test
examples/rsa-verify-test
examples/setup-env
tools/nettle-pbkdf2-test
tools/pkcs1-conv-test
tools/sexp-conv-test

index fe7974c893630627f72c4772a55964bc0aec5d64..1cab94c2769209a4f4af743b4bd28bafabe9d54d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+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.
index b542705064ba9ea71f3fa25b2ffa82af203097a0..4f27e663a00d9191c3b3b70cd679318e06a1feac 100644 (file)
@@ -803,14 +803,7 @@ case "$host_os" in
         ;;
     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
index ff935fb0abdc331686895602b3a94fad5b5abe7f..83b951c65fdeaf32da93b28bedd65387cae206ca 100755 (executable)
@@ -7,12 +7,12 @@ fi
 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
index 99d90dfcf023721e72b4755a2b8d7103f5b632c9..5cd0d3fa02a428e5c97e1a7f45ceabee5e15343d 100755 (executable)
@@ -7,7 +7,7 @@ fi
 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
index 13c143cb3f4cfe892540fc81aa41324777dabb99..66dcaa25fbbd111d8cb348c91302d7b09ff5e7a1 100755 (executable)
@@ -7,20 +7,20 @@ fi
 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
index 3ebef2c8b7d5b673c96d88d64103df180b0edeae..ba2709486c0efbbf1e247225b89c31987cac58e1 100755 (executable)
@@ -3,5 +3,5 @@
 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
index 2229cb9b8b47c53774997a166dda378a7e7f8755..6e9b25aca153bf5cca3c5393af6fd6d5dfa7e4a5 100755 (executable)
@@ -15,7 +15,7 @@ test_pbkdf2 () {
 
     # 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
 
index 0cc28b494813d2fac58b0873268d873710e4ad7d..9615625990818eee62113f2f395bcec7edc8854c 100755 (executable)
@@ -7,7 +7,7 @@ fi
 [ -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
@@ -25,7 +25,7 @@ PSVKy/gGBeN1Q7Rj+XoybQ/SqLpfgTYRI9UpbKmpkNuq
 -----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
@@ -35,7 +35,7 @@ jM9lGSEw4oXLrp7x/XVo/fZMUcRWq5H8Z0l6KANXHwcVcsjjqPBJ6WD/Is3o9rb5
 -----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
@@ -45,7 +45,7 @@ cat > testsignature2 <<EOF && diff testsignature testsignature2 || exit 1
 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
 
index 587f16df5df1e184d0990fba3b9181306ad6e7b2..9ebdeea8c3db512aeb3ce20c26aa710aed18c0f3 100755 (executable)
@@ -14,7 +14,7 @@ print_nl () {
 
 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
@@ -30,7 +30,7 @@ test_advanced () {
 
 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
@@ -46,7 +46,7 @@ test_advanced_hex () {
 
 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
@@ -62,7 +62,7 @@ test_transport () {
 
 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