Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src-all/rev/8bd49c0a7da0
branches:  trunk
changeset: 934941:8bd49c0a7da0
user:      Taylor R Campbell <riastradh%NetBSD.org@localhost>
date:      Mon Jun 15 20:04:52 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 |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 0f28688b875b -r 8bd49c0a7da0 sys/dev/cgd.c
--- a/sys/dev/cgd.c     Sun Jun 14 19:59:13 2020 +0000
+++ b/sys/dev/cgd.c     Mon Jun 15 20:04:52 2020 +0000
@@ -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