[PATCH 14/27] tests: check decoding of crypto_user_alg CRYPTOCFGA_REPORT_AEAD attribute

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


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

diff --git a/tests/nlattr_crypto_user_alg.c b/tests/nlattr_crypto_user_alg.c
index 03eaef2..497e77a 100644
--- a/tests/nlattr_crypto_user_alg.c
+++ b/tests/nlattr_crypto_user_alg.c
@@ -128,6 +128,25 @@ main(void)
 			      printf("}"));
 #endif
 
+#ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD
+	struct crypto_report_aead raead = {
+		.type = "abcd",
+		.geniv = "efgh",
+		.blocksize = 0xbaefdbac,
+		.maxauthsize = 0xfdbdbcda,
+		.ivsize = 0xacbefdac
+	};
+	TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
+			      init_crypto_user_alg, print_crypto_user_alg,
+			      CRYPTOCFGA_REPORT_AEAD,
+			      pattern, raead, print_quoted_memory,
+			      printf("{type=\"abcd\", geniv=\"efgh\"");
+			      PRINT_FIELD_U(", ", raead, blocksize);
+			      PRINT_FIELD_U(", ", raead, maxauthsize);
+			      PRINT_FIELD_U(", ", raead, ivsize);
+			      printf("}"));
+#endif
+
 	puts("+++ exited with 0 +++");
 	return 0;
 }
-- 
2.7.4





More information about the Strace-devel mailing list