|
|
86f512 |
From c9e520582586dd309462646d330654e02c531226 Mon Sep 17 00:00:00 2001
|
|
|
86f512 |
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
86f512 |
Date: Thu, 10 Oct 2019 18:19:31 +0200
|
|
|
86f512 |
Subject: [PATCH 59/76] tests: introduce TEST_NLATTR_OBJECT_MINSZ
|
|
|
86f512 |
|
|
|
86f512 |
It is useful in cases where a structure grows over time and we support
|
|
|
86f512 |
decoding of only part of it.
|
|
|
86f512 |
|
|
|
86f512 |
* tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_, TEST_NLATTR_OBJECT_EX):
|
|
|
86f512 |
Add minsz_ parameter, use it instead of sizeof(obj_).
|
|
|
86f512 |
(TEST_NLATTR_OBJECT): Pass sizeof(obj_) as minsz_.
|
|
|
86f512 |
(TEST_NLATTR_OBJECT_MINSZ): New macro.
|
|
|
86f512 |
* tests/nlattr_crypto_user_alg.c (main): Add proper minsz_ argument to
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX instances.
|
|
|
86f512 |
---
|
|
|
86f512 |
tests/nlattr_crypto_user_alg.c | 14 +++++++++-----
|
|
|
86f512 |
tests/test_nlattr.h | 27 +++++++++++++++++----------
|
|
|
86f512 |
2 files changed, 26 insertions(+), 15 deletions(-)
|
|
|
86f512 |
|
|
|
86f512 |
Index: strace-5.1/tests/nlattr_crypto_user_alg.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests/nlattr_crypto_user_alg.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests/nlattr_crypto_user_alg.c 2020-01-29 12:33:55.598689093 +0100
|
|
|
86f512 |
@@ -85,7 +85,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_HASH,
|
|
|
86f512 |
- pattern, rhash, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rhash, sizeof(rhash),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rhash, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rhash, digestsize);
|
|
|
86f512 |
@@ -104,7 +105,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_BLKCIPHER,
|
|
|
86f512 |
- pattern, rblkcipher, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rblkcipher, sizeof(rblkcipher),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\", geniv=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rblkcipher, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rblkcipher, min_keysize);
|
|
|
86f512 |
@@ -124,7 +126,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_AEAD,
|
|
|
86f512 |
- pattern, raead, print_quoted_memory,
|
|
|
86f512 |
+ pattern, raead, sizeof(raead),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\", geniv=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", raead, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", raead, maxauthsize);
|
|
|
86f512 |
@@ -140,7 +143,7 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_RNG,
|
|
|
86f512 |
- pattern, rrng, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rrng, sizeof(rrng), print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rrng, seedsize);
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
@@ -156,7 +159,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_CIPHER,
|
|
|
86f512 |
- pattern, rcipher, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rcipher, sizeof(rcipher),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rcipher, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rcipher, min_keysize);
|
|
|
86f512 |
Index: strace-5.1/tests/test_nlattr.h
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests/test_nlattr.h 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests/test_nlattr.h 2020-01-29 12:33:55.604689038 +0100
|
|
|
86f512 |
@@ -96,11 +96,9 @@
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
nla_type_, nla_type_str_, \
|
|
|
86f512 |
- pattern_, obj_, fallback_func, ...) \
|
|
|
86f512 |
+ pattern_, obj_, minsz_, fallback_func, ...) \
|
|
|
86f512 |
do { \
|
|
|
86f512 |
- const unsigned int plen = \
|
|
|
86f512 |
- sizeof(obj_) - 1 > DEFAULT_STRLEN \
|
|
|
86f512 |
- ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \
|
|
|
86f512 |
+ const unsigned int plen = MIN((minsz_) - 1, DEFAULT_STRLEN); \
|
|
|
86f512 |
/* len < sizeof(obj_) */ \
|
|
|
86f512 |
if (plen > 0) \
|
|
|
86f512 |
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
@@ -113,7 +111,7 @@
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), (nla_type_str_), \
|
|
|
86f512 |
sizeof(obj_), \
|
|
|
86f512 |
- (pattern_), sizeof(obj_) - 1, \
|
|
|
86f512 |
+ (pattern_), (minsz_) - 1, \
|
|
|
86f512 |
printf("%p", \
|
|
|
86f512 |
RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))))); \
|
|
|
86f512 |
/* sizeof(obj_) */ \
|
|
|
86f512 |
@@ -128,12 +126,12 @@
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
nla_type_, \
|
|
|
86f512 |
- pattern_, obj_, fallback_func, ...) \
|
|
|
86f512 |
+ pattern_, obj_, minsz_, fallback_func, ...) \
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), #nla_type_, \
|
|
|
86f512 |
- (pattern_), (obj_), (fallback_func), \
|
|
|
86f512 |
- __VA_ARGS__)
|
|
|
86f512 |
+ (pattern_), (obj_), (minsz_), \
|
|
|
86f512 |
+ (fallback_func), __VA_ARGS__)
|
|
|
86f512 |
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
@@ -141,8 +139,17 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), #nla_type_, \
|
|
|
86f512 |
- (pattern_), (obj_), print_quoted_hex, \
|
|
|
86f512 |
- __VA_ARGS__)
|
|
|
86f512 |
+ (pattern_), (obj_), sizeof(obj_), \
|
|
|
86f512 |
+ print_quoted_hex, __VA_ARGS__)
|
|
|
86f512 |
+
|
|
|
86f512 |
+#define TEST_NLATTR_OBJECT_MINSZ(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
+ init_msg_, print_msg_, \
|
|
|
86f512 |
+ nla_type_, pattern_, obj_, minsz_, ...) \
|
|
|
86f512 |
+ TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
+ (init_msg_), (print_msg_), \
|
|
|
86f512 |
+ (nla_type_), #nla_type_, \
|
|
|
86f512 |
+ (pattern_), (obj_), (minsz_), \
|
|
|
86f512 |
+ print_quoted_hex, __VA_ARGS__)
|
|
|
86f512 |
|
|
|
86f512 |
#define TEST_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
Index: strace-5.1/tests-m32/nlattr_crypto_user_alg.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-m32/nlattr_crypto_user_alg.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-m32/nlattr_crypto_user_alg.c 2020-01-29 12:35:29.940886920 +0100
|
|
|
86f512 |
@@ -85,7 +85,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_HASH,
|
|
|
86f512 |
- pattern, rhash, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rhash, sizeof(rhash),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rhash, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rhash, digestsize);
|
|
|
86f512 |
@@ -104,7 +105,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_BLKCIPHER,
|
|
|
86f512 |
- pattern, rblkcipher, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rblkcipher, sizeof(rblkcipher),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\", geniv=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rblkcipher, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rblkcipher, min_keysize);
|
|
|
86f512 |
@@ -124,7 +126,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_AEAD,
|
|
|
86f512 |
- pattern, raead, print_quoted_memory,
|
|
|
86f512 |
+ pattern, raead, sizeof(raead),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\", geniv=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", raead, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", raead, maxauthsize);
|
|
|
86f512 |
@@ -140,7 +143,7 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_RNG,
|
|
|
86f512 |
- pattern, rrng, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rrng, sizeof(rrng), print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rrng, seedsize);
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
@@ -156,7 +159,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_CIPHER,
|
|
|
86f512 |
- pattern, rcipher, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rcipher, sizeof(rcipher),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rcipher, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rcipher, min_keysize);
|
|
|
86f512 |
Index: strace-5.1/tests-m32/test_nlattr.h
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-m32/test_nlattr.h 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-m32/test_nlattr.h 2020-01-29 12:35:30.010886327 +0100
|
|
|
86f512 |
@@ -96,11 +96,9 @@
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
nla_type_, nla_type_str_, \
|
|
|
86f512 |
- pattern_, obj_, fallback_func, ...) \
|
|
|
86f512 |
+ pattern_, obj_, minsz_, fallback_func, ...) \
|
|
|
86f512 |
do { \
|
|
|
86f512 |
- const unsigned int plen = \
|
|
|
86f512 |
- sizeof(obj_) - 1 > DEFAULT_STRLEN \
|
|
|
86f512 |
- ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \
|
|
|
86f512 |
+ const unsigned int plen = MIN((minsz_) - 1, DEFAULT_STRLEN); \
|
|
|
86f512 |
/* len < sizeof(obj_) */ \
|
|
|
86f512 |
if (plen > 0) \
|
|
|
86f512 |
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
@@ -113,7 +111,7 @@
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), (nla_type_str_), \
|
|
|
86f512 |
sizeof(obj_), \
|
|
|
86f512 |
- (pattern_), sizeof(obj_) - 1, \
|
|
|
86f512 |
+ (pattern_), (minsz_) - 1, \
|
|
|
86f512 |
printf("%p", \
|
|
|
86f512 |
RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))))); \
|
|
|
86f512 |
/* sizeof(obj_) */ \
|
|
|
86f512 |
@@ -128,12 +126,12 @@
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
nla_type_, \
|
|
|
86f512 |
- pattern_, obj_, fallback_func, ...) \
|
|
|
86f512 |
+ pattern_, obj_, minsz_, fallback_func, ...) \
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), #nla_type_, \
|
|
|
86f512 |
- (pattern_), (obj_), (fallback_func), \
|
|
|
86f512 |
- __VA_ARGS__)
|
|
|
86f512 |
+ (pattern_), (obj_), (minsz_), \
|
|
|
86f512 |
+ (fallback_func), __VA_ARGS__)
|
|
|
86f512 |
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
@@ -141,8 +139,17 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), #nla_type_, \
|
|
|
86f512 |
- (pattern_), (obj_), print_quoted_hex, \
|
|
|
86f512 |
- __VA_ARGS__)
|
|
|
86f512 |
+ (pattern_), (obj_), sizeof(obj_), \
|
|
|
86f512 |
+ print_quoted_hex, __VA_ARGS__)
|
|
|
86f512 |
+
|
|
|
86f512 |
+#define TEST_NLATTR_OBJECT_MINSZ(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
+ init_msg_, print_msg_, \
|
|
|
86f512 |
+ nla_type_, pattern_, obj_, minsz_, ...) \
|
|
|
86f512 |
+ TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
+ (init_msg_), (print_msg_), \
|
|
|
86f512 |
+ (nla_type_), #nla_type_, \
|
|
|
86f512 |
+ (pattern_), (obj_), (minsz_), \
|
|
|
86f512 |
+ print_quoted_hex, __VA_ARGS__)
|
|
|
86f512 |
|
|
|
86f512 |
#define TEST_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
Index: strace-5.1/tests-mx32/nlattr_crypto_user_alg.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-mx32/nlattr_crypto_user_alg.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-mx32/nlattr_crypto_user_alg.c 2020-01-29 12:35:29.946886869 +0100
|
|
|
86f512 |
@@ -85,7 +85,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_HASH,
|
|
|
86f512 |
- pattern, rhash, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rhash, sizeof(rhash),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rhash, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rhash, digestsize);
|
|
|
86f512 |
@@ -104,7 +105,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_BLKCIPHER,
|
|
|
86f512 |
- pattern, rblkcipher, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rblkcipher, sizeof(rblkcipher),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\", geniv=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rblkcipher, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rblkcipher, min_keysize);
|
|
|
86f512 |
@@ -124,7 +126,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_AEAD,
|
|
|
86f512 |
- pattern, raead, print_quoted_memory,
|
|
|
86f512 |
+ pattern, raead, sizeof(raead),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\", geniv=\"efgh\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", raead, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", raead, maxauthsize);
|
|
|
86f512 |
@@ -140,7 +143,7 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_RNG,
|
|
|
86f512 |
- pattern, rrng, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rrng, sizeof(rrng), print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rrng, seedsize);
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
@@ -156,7 +159,8 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_crypto_user_alg, print_crypto_user_alg,
|
|
|
86f512 |
CRYPTOCFGA_REPORT_CIPHER,
|
|
|
86f512 |
- pattern, rcipher, print_quoted_memory,
|
|
|
86f512 |
+ pattern, rcipher, sizeof(rcipher),
|
|
|
86f512 |
+ print_quoted_memory,
|
|
|
86f512 |
printf("{type=\"abcd\"");
|
|
|
86f512 |
PRINT_FIELD_U(", ", rcipher, blocksize);
|
|
|
86f512 |
PRINT_FIELD_U(", ", rcipher, min_keysize);
|
|
|
86f512 |
Index: strace-5.1/tests-mx32/test_nlattr.h
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-mx32/test_nlattr.h 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-mx32/test_nlattr.h 2020-01-29 12:35:30.012886310 +0100
|
|
|
86f512 |
@@ -96,11 +96,9 @@
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
nla_type_, nla_type_str_, \
|
|
|
86f512 |
- pattern_, obj_, fallback_func, ...) \
|
|
|
86f512 |
+ pattern_, obj_, minsz_, fallback_func, ...) \
|
|
|
86f512 |
do { \
|
|
|
86f512 |
- const unsigned int plen = \
|
|
|
86f512 |
- sizeof(obj_) - 1 > DEFAULT_STRLEN \
|
|
|
86f512 |
- ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \
|
|
|
86f512 |
+ const unsigned int plen = MIN((minsz_) - 1, DEFAULT_STRLEN); \
|
|
|
86f512 |
/* len < sizeof(obj_) */ \
|
|
|
86f512 |
if (plen > 0) \
|
|
|
86f512 |
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
@@ -113,7 +111,7 @@
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), (nla_type_str_), \
|
|
|
86f512 |
sizeof(obj_), \
|
|
|
86f512 |
- (pattern_), sizeof(obj_) - 1, \
|
|
|
86f512 |
+ (pattern_), (minsz_) - 1, \
|
|
|
86f512 |
printf("%p", \
|
|
|
86f512 |
RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))))); \
|
|
|
86f512 |
/* sizeof(obj_) */ \
|
|
|
86f512 |
@@ -128,12 +126,12 @@
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
nla_type_, \
|
|
|
86f512 |
- pattern_, obj_, fallback_func, ...) \
|
|
|
86f512 |
+ pattern_, obj_, minsz_, fallback_func, ...) \
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), #nla_type_, \
|
|
|
86f512 |
- (pattern_), (obj_), (fallback_func), \
|
|
|
86f512 |
- __VA_ARGS__)
|
|
|
86f512 |
+ (pattern_), (obj_), (minsz_), \
|
|
|
86f512 |
+ (fallback_func), __VA_ARGS__)
|
|
|
86f512 |
|
|
|
86f512 |
#define TEST_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|
|
|
86f512 |
@@ -141,8 +139,17 @@
|
|
|
86f512 |
TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
(init_msg_), (print_msg_), \
|
|
|
86f512 |
(nla_type_), #nla_type_, \
|
|
|
86f512 |
- (pattern_), (obj_), print_quoted_hex, \
|
|
|
86f512 |
- __VA_ARGS__)
|
|
|
86f512 |
+ (pattern_), (obj_), sizeof(obj_), \
|
|
|
86f512 |
+ print_quoted_hex, __VA_ARGS__)
|
|
|
86f512 |
+
|
|
|
86f512 |
+#define TEST_NLATTR_OBJECT_MINSZ(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
+ init_msg_, print_msg_, \
|
|
|
86f512 |
+ nla_type_, pattern_, obj_, minsz_, ...) \
|
|
|
86f512 |
+ TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \
|
|
|
86f512 |
+ (init_msg_), (print_msg_), \
|
|
|
86f512 |
+ (nla_type_), #nla_type_, \
|
|
|
86f512 |
+ (pattern_), (obj_), (minsz_), \
|
|
|
86f512 |
+ print_quoted_hex, __VA_ARGS__)
|
|
|
86f512 |
|
|
|
86f512 |
#define TEST_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \
|
|
|
86f512 |
init_msg_, print_msg_, \
|