diff --git a/ChangeLog b/ChangeLog
index 674d2136932856a5ee747fc808b4a79bc114743c..269a0cc06574f356ca1be2a36ceefdb1ee9f46a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-05-28  Niels Möller  <nisse@lysator.liu.se>
 
+	* testsuite/nettle-pbkdf2-test: Delete carriage return characters
+	from output.
+
 	* configure.ac (LIBHOGWEED_LIBS): Be explicit and link
 	libhogweed.so with libnettle.so, not -lnettle.
 	(LIBHOGWEED_LINK): Drop -L. flag, no longer needed, and previously
diff --git a/testsuite/nettle-pbkdf2-test b/testsuite/nettle-pbkdf2-test
index e1241e16fcc0d5109abca95c7dfb72c308444ba9..fb18c42f3eb3b64ecd12524ae754d4d4d8a2ba75 100755
--- a/testsuite/nettle-pbkdf2-test
+++ b/testsuite/nettle-pbkdf2-test
@@ -13,9 +13,11 @@ test_pbkdf2 () {
     # $expected contains more than one space.
     length=`expr "$expected" : '.*' / 2`
 
+    # Delete carriage return characters, needed when testing with
+    # wine.
     printf "%s" "$password" | $EMULATOR ../tools/nettle-pbkdf2 \
-	-i "$iters" -l "$length" "$salt" > test1.out
-    echo "$expected" > test2.out
+	-i "$iters" -l "$length" "$salt" | tr -d '\r' > test1.out
+    echo "$expected" | tr -d '\r' > test2.out
 
     if cmp test1.out test2.out ; then
 	true