Module Name:    src
Committed By:   pgoyette
Date:           Fri Jan 17 19:35:33 UTC 2014

Modified Files:
        src/tests/crypto/opencrypto: h_null.c t_opencrypto.sh

Log Message:
Reenable h_null (NULL_CBC) test.  It works if we correctly pass a NULL iv.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/crypto/opencrypto/h_null.c \
    src/tests/crypto/opencrypto/t_opencrypto.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/crypto/opencrypto/h_null.c
diff -u src/tests/crypto/opencrypto/h_null.c:1.2 src/tests/crypto/opencrypto/h_null.c:1.3
--- src/tests/crypto/opencrypto/h_null.c:1.2	Fri Jan 17 14:16:08 2014
+++ src/tests/crypto/opencrypto/h_null.c	Fri Jan 17 19:35:33 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: h_null.c,v 1.2 2014/01/17 14:16:08 pgoyette Exp $ */
+/* $NetBSD: h_null.c,v 1.3 2014/01/17 19:35:33 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -37,12 +37,7 @@
 #include <crypto/cryptodev.h>
 
 unsigned char key[] = "abcdefgh";
-unsigned char iv[8] = {0};
 char plaintx[16] = "1234567890123456";
-const unsigned char ciphertx[16] = {
-	0x21, 0xc6, 0x0d, 0xa5, 0x34, 0x24, 0x8b, 0xce,
-	0x95, 0x86, 0x64, 0xb3, 0x66, 0x77, 0x9b, 0x4c
-};
 
 int
 main(void)
@@ -70,12 +65,11 @@ main(void)
 	co.src = plaintx;
 	co.dst = buf;
 	co.dst_len = sizeof(buf);
-	co.iv = iv;
 	res = ioctl(fd, CIOCCRYPT, &co);
 	if (res < 0)
 		err(1, "CIOCCRYPT");
 
-	if (memcmp(co.dst, ciphertx, sizeof(ciphertx)))
+	if (memcmp(co.dst, plaintx, sizeof(plaintx)))
 		errx(1, "verification failed");
 
 	return 0;
Index: src/tests/crypto/opencrypto/t_opencrypto.sh
diff -u src/tests/crypto/opencrypto/t_opencrypto.sh:1.2 src/tests/crypto/opencrypto/t_opencrypto.sh:1.3
--- src/tests/crypto/opencrypto/t_opencrypto.sh:1.2	Fri Jan 17 14:14:54 2014
+++ src/tests/crypto/opencrypto/t_opencrypto.sh	Fri Jan 17 19:35:33 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: t_opencrypto.sh,v 1.2 2014/01/17 14:14:54 pgoyette Exp $
+#	$NetBSD: t_opencrypto.sh,v 1.3 2014/01/17 19:35:33 pgoyette Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -215,7 +215,6 @@ md5_hmac_cleanup() {
 
 atf_test_case null cleanup
 null_head() {
-	atf_skip "NULL_CBC not implemented by swcrypto"
 	common_head "Test NULL_CBC crypto"
 }
 

Reply via email to