Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/crypto/opencrypto Reenable h_null (NULL_CBC) test. It...
details: https://anonhg.NetBSD.org/src/rev/e34d6022867a
branches: trunk
changeset: 326084:e34d6022867a
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Fri Jan 17 19:35:33 2014 +0000
description:
Reenable h_null (NULL_CBC) test. It works if we correctly pass a NULL iv.
diffstat:
tests/crypto/opencrypto/h_null.c | 10 ++--------
tests/crypto/opencrypto/t_opencrypto.sh | 3 +--
2 files changed, 3 insertions(+), 10 deletions(-)
diffs (53 lines):
diff -r 24e3e26aa806 -r e34d6022867a tests/crypto/opencrypto/h_null.c
--- a/tests/crypto/opencrypto/h_null.c Fri Jan 17 19:06:57 2014 +0000
+++ b/tests/crypto/opencrypto/h_null.c Fri Jan 17 19:35:33 2014 +0000
@@ -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 @@
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;
diff -r 24e3e26aa806 -r e34d6022867a tests/crypto/opencrypto/t_opencrypto.sh
--- a/tests/crypto/opencrypto/t_opencrypto.sh Fri Jan 17 19:06:57 2014 +0000
+++ b/tests/crypto/opencrypto/t_opencrypto.sh Fri Jan 17 19:35:33 2014 +0000
@@ -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 @@
atf_test_case null cleanup
null_head() {
- atf_skip "NULL_CBC not implemented by swcrypto"
common_head "Test NULL_CBC crypto"
}
Home |
Main Index |
Thread Index |
Old Index