Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev cgd(4): Print which key size is broken when a self-t...



details:   https://anonhg.NetBSD.org/src/rev/b07e63ca8daa
branches:  trunk
changeset: 935307:b07e63ca8daa
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Jun 29 23:35:26 2020 +0000

description:
cgd(4): Print which key size is broken when a self-test fails.

Can be gleaned from the test index but this is a little quicker.

diffstat:

 sys/dev/cgd.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r b5558c5c1d45 -r b07e63ca8daa sys/dev/cgd.c
--- a/sys/dev/cgd.c     Mon Jun 29 23:34:48 2020 +0000
+++ b/sys/dev/cgd.c     Mon Jun 29 23:35:26 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.135 2020/06/17 20:44:45 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.136 2020/06/29 23:35:26 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.135 2020/06/17 20:44:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.136 2020/06/29 23:35:26 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1699,8 +1699,8 @@
                if (memcmp(buf, selftests[i].ctxt, txtlen) != 0) {
                        hexdump(printf, "was", buf, txtlen);
                        hexdump(printf, "exp", selftests[i].ctxt, txtlen);
-                       panic("cgd %s encryption is broken [%zu]",
-                           selftests[i].alg, i);
+                       panic("cgd %s-%d encryption is broken [%zu]",
+                           selftests[i].alg, keylen, i);
                }
 
                cgd_cipher(&sc, buf, buf, txtlen, selftests[i].blkno,
@@ -1708,8 +1708,8 @@
                if (memcmp(buf, selftests[i].ptxt, txtlen) != 0) {
                        hexdump(printf, "was", buf, txtlen);
                        hexdump(printf, "exp", selftests[i].ptxt, txtlen);
-                       panic("cgd %s decryption is broken [%zu]",
-                           selftests[i].alg, i);
+                       panic("cgd %s-%d decryption is broken [%zu]",
+                           selftests[i].alg, keylen, i);
                }
 
                kmem_free(buf, txtlen);



Home | Main Index | Thread Index | Old Index