[PATCH 20/27] tests: check decoding of crypto_user_alg CRYPTOCFGA_REPORT_CIPHER attribute

JingPiao Chen chenjingpiao at gmail.com
Sat Jul 22 12:43:50 UTC 2017


* tests/nlattr_crypto_user_alg.c (main): Check decoding of
CRYPTOCFGA_REPORT_CIPHER attribute.
---
 tests/nlattr_crypto_user_alg.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/nlattr_crypto_user_alg.c b/tests/nlattr_crypto_user_alg.c
index 15111b1..584684e 100644
--- a/tests/nlattr_crypto_user_alg.c
+++ b/tests/nlattr_crypto_user_alg.c
@@ -172,6 +172,24 @@ main(void)
 			      printf("}"));
 #endif
 
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER
+	struct crypto_report_cipher rcipher = {
+		.type = "abcd",
+		.blocksize = 0xabcdefac,
+		.min_keysize = 0xfeadbcda,
+		.max_keysize = 0xbdacdeac,
+	};
+	TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
+			      init_crypto_user_alg, print_crypto_user_alg,
+			      CRYPTOCFGA_REPORT_CIPHER,
+			      pattern, rcipher, print_quoted_memory,
+			      printf("{type=\"abcd\"");
+			      PRINT_FIELD_U(", ", rcipher, blocksize);
+			      PRINT_FIELD_U(", ", rcipher, min_keysize);
+			      PRINT_FIELD_U(", ", rcipher, max_keysize);
+			      printf("}"));
+#endif
+
 	puts("+++ exited with 0 +++");
 	return 0;
 }
-- 
2.7.4





More information about the Strace-devel mailing list