Apply clang formatting.
Executed with:
`find . -regextype posix-egrep -regex ".*\.([hc]|fmt|function)" | xargs -L1 clang-format-12 -i`
Signed-off-by: Mateusz Starzyk <mateusz.starzyk@mobica.com>
diff --git a/tests/src/asn1_helpers.c b/tests/src/asn1_helpers.c
index 8ece1e3..126e2df 100644
--- a/tests/src/asn1_helpers.c
+++ b/tests/src/asn1_helpers.c
@@ -25,50 +25,48 @@
#if defined(MBEDTLS_ASN1_PARSE_C)
-#include <mbedtls/asn1.h>
+# include <mbedtls/asn1.h>
-int mbedtls_test_asn1_skip_integer( unsigned char **p, const unsigned char *end,
- size_t min_bits, size_t max_bits,
- int must_be_odd )
+int mbedtls_test_asn1_skip_integer(unsigned char **p,
+ const unsigned char *end,
+ size_t min_bits,
+ size_t max_bits,
+ int must_be_odd)
{
size_t len;
size_t actual_bits;
unsigned char msb;
- TEST_EQUAL( mbedtls_asn1_get_tag( p, end, &len,
- MBEDTLS_ASN1_INTEGER ),
- 0 );
+ TEST_EQUAL(mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_INTEGER), 0);
/* Check if the retrieved length doesn't extend the actual buffer's size.
* It is assumed here, that end >= p, which validates casting to size_t. */
- TEST_ASSERT( len <= (size_t)( end - *p) );
+ TEST_ASSERT(len <= (size_t)(end - *p));
/* Tolerate a slight departure from DER encoding:
* - 0 may be represented by an empty string or a 1-byte string.
* - The sign bit may be used as a value bit. */
- if( ( len == 1 && ( *p )[0] == 0 ) ||
- ( len > 1 && ( *p )[0] == 0 && ( ( *p )[1] & 0x80 ) != 0 ) )
- {
- ++( *p );
+ if ((len == 1 && (*p)[0] == 0) ||
+ (len > 1 && (*p)[0] == 0 && ((*p)[1] & 0x80) != 0)) {
+ ++(*p);
--len;
}
- if( min_bits == 0 && len == 0 )
- return 1 ;
- msb = ( *p )[0];
- TEST_ASSERT( msb != 0 );
- actual_bits = 8 * ( len - 1 );
- while( msb != 0 )
- {
+ if (min_bits == 0 && len == 0)
+ return 1;
+ msb = (*p)[0];
+ TEST_ASSERT(msb != 0);
+ actual_bits = 8 * (len - 1);
+ while (msb != 0) {
msb >>= 1;
++actual_bits;
}
- TEST_ASSERT( actual_bits >= min_bits );
- TEST_ASSERT( actual_bits <= max_bits );
- if( must_be_odd )
- TEST_ASSERT( ( ( *p )[len-1] & 1 ) != 0 );
+ TEST_ASSERT(actual_bits >= min_bits);
+ TEST_ASSERT(actual_bits <= max_bits);
+ if (must_be_odd)
+ TEST_ASSERT(((*p)[len - 1] & 1) != 0);
*p += len;
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
#endif /* MBEDTLS_ASN1_PARSE_C */
diff --git a/tests/src/certs.c b/tests/src/certs.c
index 831395c..4d97318 100644
--- a/tests/src/certs.c
+++ b/tests/src/certs.c
@@ -53,57 +53,64 @@
/* END FILE */
/* This is generated from tests/data_files/test-ca2.crt.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_CA_CRT_EC_DER tests/data_files/test-ca2.crt.der */
-#define TEST_CA_CRT_EC_DER { \
- 0x30, 0x82, 0x02, 0x04, 0x30, 0x82, 0x01, 0x88, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, \
- 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, \
- 0x05, 0x00, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, \
- 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, \
- 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x50, \
- 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, \
- 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, \
- 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x17, \
- 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, \
- 0x30, 0x5a, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, \
- 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, \
- 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x50, \
- 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, \
- 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, \
- 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, \
- 0x00, 0x22, 0x03, 0x62, 0x00, 0x04, 0xc3, 0xda, 0x2b, 0x34, 0x41, 0x37, \
- 0x58, 0x2f, 0x87, 0x56, 0xfe, 0xfc, 0x89, 0xba, 0x29, 0x43, 0x4b, 0x4e, \
- 0xe0, 0x6e, 0xc3, 0x0e, 0x57, 0x53, 0x33, 0x39, 0x58, 0xd4, 0x52, 0xb4, \
- 0x91, 0x95, 0x39, 0x0b, 0x23, 0xdf, 0x5f, 0x17, 0x24, 0x62, 0x48, 0xfc, \
- 0x1a, 0x95, 0x29, 0xce, 0x2c, 0x2d, 0x87, 0xc2, 0x88, 0x52, 0x80, 0xaf, \
- 0xd6, 0x6a, 0xab, 0x21, 0xdd, 0xb8, 0xd3, 0x1c, 0x6e, 0x58, 0xb8, 0xca, \
- 0xe8, 0xb2, 0x69, 0x8e, 0xf3, 0x41, 0xad, 0x29, 0xc3, 0xb4, 0x5f, 0x75, \
- 0xa7, 0x47, 0x6f, 0xd5, 0x19, 0x29, 0x55, 0x69, 0x9a, 0x53, 0x3b, 0x20, \
- 0xb4, 0x66, 0x16, 0x60, 0x33, 0x1e, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x0c, \
- 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, \
- 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x9d, \
- 0x6d, 0x20, 0x24, 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, \
- 0x7e, 0x24, 0xc9, 0xdb, 0xfb, 0x36, 0x7c, 0x30, 0x1f, 0x06, 0x03, 0x55, \
- 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, \
- 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, \
- 0xdb, 0xfb, 0x36, 0x7c, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \
- 0x3d, 0x04, 0x03, 0x02, 0x05, 0x00, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, \
- 0x30, 0x51, 0xca, 0xae, 0x30, 0x0f, 0xa4, 0x70, 0x74, 0x04, 0xdd, 0x5a, \
- 0x2c, 0x7f, 0x13, 0xc1, 0xc2, 0x77, 0xbe, 0x1d, 0x00, 0xc5, 0xe2, 0x99, \
- 0x8f, 0x7d, 0x26, 0x45, 0xd3, 0x8a, 0x06, 0x68, 0x3f, 0x8c, 0xb4, 0xb7, \
- 0xad, 0x4d, 0xe0, 0xf1, 0x54, 0x01, 0x1e, 0x99, 0xfc, 0xb0, 0xe4, 0xd3, \
- 0x07, 0x02, 0x31, 0x00, 0xdc, 0x4f, 0x3b, 0x90, 0x1e, 0xae, 0x29, 0x99, \
- 0x84, 0x28, 0xcc, 0x7b, 0x47, 0x78, 0x09, 0x31, 0xdf, 0xd6, 0x01, 0x59, \
- 0x30, 0x5e, 0xf4, 0xf8, 0x8a, 0x84, 0x3f, 0xea, 0x39, 0x54, 0x7b, 0x08, \
- 0xa7, 0x60, 0xaa, 0xbd, 0xf9, 0x5b, 0xd1, 0x51, 0x96, 0x14, 0x2e, 0x65, \
- 0xf5, 0xae, 0x1c, 0x42 \
-}
+/* BEGIN FILE binary macro TEST_CA_CRT_EC_DER tests/data_files/test-ca2.crt.der
+ */
+#define TEST_CA_CRT_EC_DER \
+ { \
+ 0x30, 0x82, 0x02, 0x04, 0x30, 0x82, 0x01, 0x88, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, \
+ 0xcc, 0xe8, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
+ 0x04, 0x03, 0x02, 0x05, 0x00, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \
+ 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
+ 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, \
+ 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, \
+ 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, \
+ 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, \
+ 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, 0x32, \
+ 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x17, 0x0d, \
+ 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, \
+ 0x30, 0x5a, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, \
+ 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
+ 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, \
+ 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \
+ 0x03, 0x0c, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, \
+ 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, \
+ 0x30, 0x76, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
+ 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, \
+ 0x00, 0x04, 0xc3, 0xda, 0x2b, 0x34, 0x41, 0x37, 0x58, 0x2f, 0x87, \
+ 0x56, 0xfe, 0xfc, 0x89, 0xba, 0x29, 0x43, 0x4b, 0x4e, 0xe0, 0x6e, \
+ 0xc3, 0x0e, 0x57, 0x53, 0x33, 0x39, 0x58, 0xd4, 0x52, 0xb4, 0x91, \
+ 0x95, 0x39, 0x0b, 0x23, 0xdf, 0x5f, 0x17, 0x24, 0x62, 0x48, 0xfc, \
+ 0x1a, 0x95, 0x29, 0xce, 0x2c, 0x2d, 0x87, 0xc2, 0x88, 0x52, 0x80, \
+ 0xaf, 0xd6, 0x6a, 0xab, 0x21, 0xdd, 0xb8, 0xd3, 0x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x54, 0x01, \
+ 0x1e, 0x99, 0xfc, 0xb0, 0xe4, 0xd3, 0x07, 0x02, 0x31, 0x00, 0xdc, \
+ 0x4f, 0x3b, 0x90, 0x1e, 0xae, 0x29, 0x99, 0x84, 0x28, 0xcc, 0x7b, \
+ 0x47, 0x78, 0x09, 0x31, 0xdf, 0xd6, 0x01, 0x59, 0x30, 0x5e, 0xf4, \
+ 0xf8, 0x8a, 0x84, 0x3f, 0xea, 0x39, 0x54, 0x7b, 0x08, 0xa7, 0x60, \
+ 0xaa, 0xbd, 0xf9, 0x5b, 0xd1, 0x51, 0x96, 0x14, 0x2e, 0x65, 0xf5, \
+ 0xae, 0x1c, 0x42 \
+ }
/* END FILE */
/* This is taken from tests/data_files/test-ca2.key.enc */
-/* BEGIN FILE string macro TEST_CA_KEY_EC_PEM tests/data_files/test-ca2.key.enc */
+/* BEGIN FILE string macro TEST_CA_KEY_EC_PEM tests/data_files/test-ca2.key.enc
+ */
#define TEST_CA_KEY_EC_PEM \
"-----BEGIN EC PRIVATE KEY-----\r\n" \
"Proc-Type: 4,ENCRYPTED\r\n" \
@@ -119,27 +126,32 @@
#define TEST_CA_PWD_EC_PEM "PolarSSLTest"
/* This is generated from tests/data_files/test-ca2.key.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_CA_KEY_EC_DER tests/data_files/test-ca2.key.der */
-#define TEST_CA_KEY_EC_DER { \
- 0x30, 0x81, 0xa4, 0x02, 0x01, 0x01, 0x04, 0x30, 0x83, 0xd9, 0x15, 0x0e, \
- 0xa0, 0x71, 0xf0, 0x57, 0x10, 0x33, 0xa3, 0x38, 0xb8, 0x86, 0xc1, 0xa6, \
- 0x11, 0x5d, 0x6d, 0xb4, 0x03, 0xe1, 0x29, 0x76, 0x45, 0xd7, 0x87, 0x6f, \
- 0x23, 0xab, 0x44, 0x20, 0xea, 0x64, 0x7b, 0x85, 0xb1, 0x76, 0xe7, 0x85, \
- 0x95, 0xaa, 0x74, 0xd6, 0xd1, 0xa4, 0x5e, 0xea, 0xa0, 0x07, 0x06, 0x05, \
- 0x2b, 0x81, 0x04, 0x00, 0x22, 0xa1, 0x64, 0x03, 0x62, 0x00, 0x04, 0xc3, \
- 0xda, 0x2b, 0x34, 0x41, 0x37, 0x58, 0x2f, 0x87, 0x56, 0xfe, 0xfc, 0x89, \
- 0xba, 0x29, 0x43, 0x4b, 0x4e, 0xe0, 0x6e, 0xc3, 0x0e, 0x57, 0x53, 0x33, \
- 0x39, 0x58, 0xd4, 0x52, 0xb4, 0x91, 0x95, 0x39, 0x0b, 0x23, 0xdf, 0x5f, \
- 0x17, 0x24, 0x62, 0x48, 0xfc, 0x1a, 0x95, 0x29, 0xce, 0x2c, 0x2d, 0x87, \
- 0xc2, 0x88, 0x52, 0x80, 0xaf, 0xd6, 0x6a, 0xab, 0x21, 0xdd, 0xb8, 0xd3, \
- 0x1c, 0x6e, 0x58, 0xb8, 0xca, 0xe8, 0xb2, 0x69, 0x8e, 0xf3, 0x41, 0xad, \
- 0x29, 0xc3, 0xb4, 0x5f, 0x75, 0xa7, 0x47, 0x6f, 0xd5, 0x19, 0x29, 0x55, \
- 0x69, 0x9a, 0x53, 0x3b, 0x20, 0xb4, 0x66, 0x16, 0x60, 0x33, 0x1e \
-}
+/* BEGIN FILE binary macro TEST_CA_KEY_EC_DER tests/data_files/test-ca2.key.der
+ */
+#define TEST_CA_KEY_EC_DER \
+ { \
+ 0x30, 0x81, 0xa4, 0x02, 0x01, 0x01, 0x04, 0x30, 0x83, 0xd9, 0x15, \
+ 0x0e, 0xa0, 0x71, 0xf0, 0x57, 0x10, 0x33, 0xa3, 0x38, 0xb8, 0x86, \
+ 0xc1, 0xa6, 0x11, 0x5d, 0x6d, 0xb4, 0x03, 0xe1, 0x29, 0x76, 0x45, \
+ 0xd7, 0x87, 0x6f, 0x23, 0xab, 0x44, 0x20, 0xea, 0x64, 0x7b, 0x85, \
+ 0xb1, 0x76, 0xe7, 0x85, 0x95, 0xaa, 0x74, 0xd6, 0xd1, 0xa4, 0x5e, \
+ 0xea, 0xa0, 0x07, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x22, 0xa1, \
+ 0x64, 0x03, 0x62, 0x00, 0x04, 0xc3, 0xda, 0x2b, 0x34, 0x41, 0x37, \
+ 0x58, 0x2f, 0x87, 0x56, 0xfe, 0xfc, 0x89, 0xba, 0x29, 0x43, 0x4b, \
+ 0x4e, 0xe0, 0x6e, 0xc3, 0x0e, 0x57, 0x53, 0x33, 0x39, 0x58, 0xd4, \
+ 0x52, 0xb4, 0x91, 0x95, 0x39, 0x0b, 0x23, 0xdf, 0x5f, 0x17, 0x24, \
+ 0x62, 0x48, 0xfc, 0x1a, 0x95, 0x29, 0xce, 0x2c, 0x2d, 0x87, 0xc2, \
+ 0x88, 0x52, 0x80, 0xaf, 0xd6, 0x6a, 0xab, 0x21, 0xdd, 0xb8, 0xd3, \
+ 0x1c, 0x6e, 0x58, 0xb8, 0xca, 0xe8, 0xb2, 0x69, 0x8e, 0xf3, 0x41, \
+ 0xad, 0x29, 0xc3, 0xb4, 0x5f, 0x75, 0xa7, 0x47, 0x6f, 0xd5, 0x19, \
+ 0x29, 0x55, 0x69, 0x9a, 0x53, 0x3b, 0x20, 0xb4, 0x66, 0x16, 0x60, \
+ 0x33, 0x1e \
+ }
/* END FILE */
/* This is taken from tests/data_files/test-ca-sha256.crt. */
-/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA256_PEM tests/data_files/test-ca-sha256.crt */
+/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA256_PEM
+ * tests/data_files/test-ca-sha256.crt */
#define TEST_CA_CRT_RSA_SHA256_PEM \
"-----BEGIN CERTIFICATE-----\r\n" \
"MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \
@@ -165,83 +177,93 @@
/* This is generated from tests/data_files/test-ca-sha256.crt.der
* using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA256_DER tests/data_files/test-ca-sha256.crt.der */
-#define TEST_CA_CRT_RSA_SHA256_DER { \
- 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \
- 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \
- 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
- 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \
- 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
- 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \
- 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \
- 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \
- 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \
- 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \
- 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, \
- 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, \
- 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \
- 0x01, 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \
- 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, \
- 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, \
- 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, \
- 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, 0x07, 0xd3, 0x9e, 0xd9, \
- 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, 0xa3, 0x30, 0x52, 0xa9, 0xf2, \
- 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, 0xa2, 0x72, 0x0b, 0xc2, 0xe5, 0x40, \
- 0xf9, 0x3e, 0xe5, 0xa6, 0x0e, 0xb3, 0xf9, 0xec, 0x4a, 0x63, 0xc0, 0xb8, \
- 0x29, 0x00, 0x74, 0x9c, 0x57, 0x3b, 0xa8, 0xa5, 0x04, 0x90, 0x71, 0xf1, \
- 0xbd, 0x83, 0xd9, 0x3f, 0xd6, 0xa5, 0xe2, 0x3c, 0x2a, 0x8f, 0xef, 0x27, \
- 0x60, 0xc3, 0xc6, 0x9f, 0xcb, 0xba, 0xec, 0x60, 0x7d, 0xb7, 0xe6, 0x84, \
- 0x32, 0xbe, 0x4f, 0xfb, 0x58, 0x26, 0x22, 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, 0xbe, 0xc2, 0xde, 0x92, 0xa8, 0x40, 0x71, 0xbb, 0x72, 0x9b, \
- 0xf8, 0x47, 0xce, 0x6c, 0x04, 0xf8, 0x86, 0xe7, 0xf7, 0x73, 0x3c, 0xe7, \
- 0x84, 0x7d, 0xc2, 0xd7, 0xb7, 0x9d, 0xe8, 0xd4, 0x9b, 0x5f, 0x0a, 0x17, \
- 0x7d, 0xbc, 0xbb, 0xb2, 0xd5, 0x94, 0x0d, 0xe4, 0x49, 0xbf, 0x4f, 0x11, \
- 0x68, 0x53, 0xb2, 0x91, 0xff, 0xc0, 0x69, 0xee, 0xdb, 0x63, 0x93, 0xcb, \
- 0xc9, 0x35, 0x6b, 0x90, 0x09, 0xe2, 0x90, 0xc9, 0xed, 0x27, 0xd6, 0x08, \
- 0xfa, 0x13, 0x4d, 0x62, 0xdd, 0xe2, 0x9e, 0xaa, 0xb5, 0xd4, 0x0e, 0x5c, \
- 0x37, 0x4f, 0xab, 0x55, 0x3b, 0x2d, 0xf1, 0x42, 0x82, 0xc7, 0x34, 0x38, \
- 0x1a, 0x9b, 0xeb, 0xa1, 0x2c, 0x0f, 0x29, 0x31, 0x64, 0x6c, 0xcc, 0x38, \
- 0xfd, 0xa9, 0xd3, 0xd5, 0xd5, 0x71, 0xaf, 0xf0, 0x6d, 0xc0, 0x97, 0xe2, \
- 0x11, 0x2a, 0x0a, 0xdf, 0xfe, 0x02, 0x79, 0x74, 0x75 \
-}
+/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA256_DER
+ * tests/data_files/test-ca-sha256.crt.der */
+#define TEST_CA_CRT_RSA_SHA256_DER \
+ { \
+ 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, \
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, \
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, \
+ 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \
+ 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, \
+ 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x10, 0x50, \
+ 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, \
+ 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, \
+ 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x17, \
+ 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, \
+ 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
+ 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, \
+ 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
+ 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
+ 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, \
+ 0x4c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, \
+ 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, \
+ 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, \
+ 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0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 0x9d, 0xe8, 0xd4, 0x9b, 0x5f, 0x0a, 0x17, 0x7d, 0xbc, 0xbb, 0xb2, \
+ 0xd5, 0x94, 0x0d, 0xe4, 0x49, 0xbf, 0x4f, 0x11, 0x68, 0x53, 0xb2, \
+ 0x91, 0xff, 0xc0, 0x69, 0xee, 0xdb, 0x63, 0x93, 0xcb, 0xc9, 0x35, \
+ 0x6b, 0x90, 0x09, 0xe2, 0x90, 0xc9, 0xed, 0x27, 0xd6, 0x08, 0xfa, \
+ 0x13, 0x4d, 0x62, 0xdd, 0xe2, 0x9e, 0xaa, 0xb5, 0xd4, 0x0e, 0x5c, \
+ 0x37, 0x4f, 0xab, 0x55, 0x3b, 0x2d, 0xf1, 0x42, 0x82, 0xc7, 0x34, \
+ 0x38, 0x1a, 0x9b, 0xeb, 0xa1, 0x2c, 0x0f, 0x29, 0x31, 0x64, 0x6c, \
+ 0xcc, 0x38, 0xfd, 0xa9, 0xd3, 0xd5, 0xd5, 0x71, 0xaf, 0xf0, 0x6d, \
+ 0xc0, 0x97, 0xe2, 0x11, 0x2a, 0x0a, 0xdf, 0xfe, 0x02, 0x79, 0x74, \
+ 0x75 \
+ }
/* END FILE */
/* This is taken from tests/data_files/test-ca-sha1.crt. */
-/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA1_PEM tests/data_files/test-ca-sha1.crt */
+/* BEGIN FILE string macro TEST_CA_CRT_RSA_SHA1_PEM
+ * tests/data_files/test-ca-sha1.crt */
#define TEST_CA_CRT_RSA_SHA1_PEM \
"-----BEGIN CERTIFICATE-----\r\n" \
"MIIDQTCCAimgAwIBAgIBAzANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \
@@ -266,79 +288,88 @@
/* END FILE */
/* This is taken from tests/data_files/test-ca-sha1.crt.der. */
-/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA1_DER tests/data_files/test-ca-sha1.crt.der */
-#define TEST_CA_CRT_RSA_SHA1_DER { \
- 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \
- 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \
- 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
- 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \
- 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
- 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \
- 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \
- 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \
- 0x34, 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \
- 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, \
- 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 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0, 0xe4, 0x2e, 0xbd, 0xfc, 0x2e, \
- 0xee, 0xe2, 0x41, 0x55, 0xc0, 0x34, 0x2e, 0x7d, 0x24, 0x72, 0x69, 0xcb, \
- 0x47, 0xb1, 0x14, 0x40, 0x83, 0x7d, 0x67, 0xf4, 0x86, 0xf6, 0x31, 0xab, \
- 0xf1, 0x79, 0xa4, 0xb2, 0xb5, 0x2e, 0x12, 0xf9, 0x84, 0x17, 0xf0, 0x62, \
- 0x6f, 0x27, 0x3e, 0x13, 0x58, 0xb1, 0x54, 0x0d, 0x21, 0x9a, 0x73, 0x37, \
- 0xa1, 0x30, 0xcf, 0x6f, 0x92, 0xdc, 0xf6, 0xe9, 0xfc, 0xac, 0xdb, 0x2e, \
- 0x28, 0xd1, 0x7e, 0x02, 0x4b, 0x23, 0xa0, 0x15, 0xf2, 0x38, 0x65, 0x64, \
- 0x09, 0xea, 0x0c, 0x6e, 0x8e, 0x1b, 0x17, 0xa0, 0x71, 0xc8, 0xb3, 0x9b, \
- 0xc9, 0xab, 0xe9, 0xc3, 0xf2, 0xcf, 0x87, 0x96, 0x8f, 0x80, 0x02, 0x32, \
- 0x9e, 0x99, 0x58, 0x6f, 0xa2, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, \
- 0x50, 0x30, 0x4e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, \
- 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, \
- 0x04, 0x16, 0x04, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, \
- 0xf6, 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, \
- 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, \
- 0x14, 0xb4, 0x5a, 0xe4, 0xa5,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, 0x36, 0x05, 0xe5, 0x90, 0x00, 0x03, 0xab, 0xd3, 0x3a, 0xb5, \
- 0x17, 0xb4, 0xd2, 0x45, 0x52, 0x69, 0x26, 0xce, 0xe3, 0x98, 0x1d, 0x9a, \
- 0x8b, 0xf8, 0xa0, 0x92, 0x1d, 0x48, 0x02, 0x37, 0x2e, 0xc1, 0x5e, 0x95, \
- 0xc2, 0x53, 0xfe, 0xb1, 0xbc, 0x34, 0x82, 0x34, 0x34, 0x36, 0x91, 0x8c, \
- 0x88, 0x7a, 0x67, 0x97, 0x34, 0x40, 0x8b, 0xfb, 0x48, 0x6e, 0xd3, 0xaf, \
- 0x30, 0x81, 0x8e, 0x05, 0x4d, 0x93, 0x21, 0xf6, 0xb1, 0xff, 0x98, 0xea, \
- 0xd5, 0xa8, 0x14, 0xc7, 0x96, 0x8f, 0x99, 0x3e, 0x53, 0x58, 0x08, 0x89, \
- 0x3c, 0xe3, 0x8f, 0xea, 0x5e, 0x71, 0x5e, 0x70, 0xf0, 0xc5, 0xe6, 0x12, \
- 0x35, 0x6a, 0xa2, 0x5f, 0xd1, 0xb2, 0xba, 0xc0, 0x59, 0x8d, 0xec, 0xda, \
- 0x09, 0xa1, 0xda, 0x6e, 0x30, 0xcb, 0x53, 0x4a, 0x90 \
-}
+/* BEGIN FILE binary macro TEST_CA_CRT_RSA_SHA1_DER
+ * tests/data_files/test-ca-sha1.crt.der */
+#define TEST_CA_CRT_RSA_SHA1_DER \
+ { \
+ 0x30, 0x82, 0x03, 0x41, 0x30, 0x82, 0x02, 0x29, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x03, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, \
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, \
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, \
+ 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \
+ 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, \
+ 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x10, 0x50, \
+ 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, \
+ 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30, \
+ 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x17, \
+ 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, \
+ 0x30, 0x30, 0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
+ 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, \
+ 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
+ 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
+ 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, \
+ 0x4c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x82, \
+ 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, \
+ 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, \
+ 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc0, 0xdf, \
+ 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, 0x86, 0xde, 0x96, \
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2e, 0xc1, 0x5e, 0x95, 0xc2, 0x53, 0xfe, \
+ 0xb1, 0xbc, 0x34, 0x82, 0x34, 0x34, 0x36, 0x91, 0x8c, 0x88, 0x7a, \
+ 0x67, 0x97, 0x34, 0x40, 0x8b, 0xfb, 0x48, 0x6e, 0xd3, 0xaf, 0x30, \
+ 0x81, 0x8e, 0x05, 0x4d, 0x93, 0x21, 0xf6, 0xb1, 0xff, 0x98, 0xea, \
+ 0xd5, 0xa8, 0x14, 0xc7, 0x96, 0x8f, 0x99, 0x3e, 0x53, 0x58, 0x08, \
+ 0x89, 0x3c, 0xe3, 0x8f, 0xea, 0x5e, 0x71, 0x5e, 0x70, 0xf0, 0xc5, \
+ 0xe6, 0x12, 0x35, 0x6a, 0xa2, 0x5f, 0xd1, 0xb2, 0xba, 0xc0, 0x59, \
+ 0x8d, 0xec, 0xda, 0x09, 0xa1, 0xda, 0x6e, 0x30, 0xcb, 0x53, 0x4a, \
+ 0x90 \
+ }
/* END FILE */
/* This is taken from tests/data_files/test-ca.key */
@@ -379,109 +410,120 @@
#define TEST_CA_PWD_RSA_PEM "PolarSSLTest"
/* This was generated from test-ca.key.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_CA_KEY_RSA_DER tests/data_files/test-ca.key.der */
-#define TEST_CA_KEY_RSA_DER { \
- 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \
- 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, 0x86, 0xde, \
- 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, 0xf1, 0x99, 0xd4, \
- 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, 0xa5, 0xec, 0x9b, 0xc5, \
- 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, 0x87, 0x1e, 0x7b, 0xc0, 0x8d, \
- 0x39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xc2, 0x2e, 0xe7, 0x81, 0x2a, 0x17, 0x34, 0x64, 0x30, \
- 0x4e, 0x96, 0xbb, 0x26, 0x16, 0xb9, 0x41, 0x36, 0xfe, 0x8a, 0xd6, 0x53, \
- 0x7c, 0xaa, 0xec, 0x39, 0x42, 0x50, 0xef, 0xe3, 0xb3, 0x01, 0x28, 0x32, \
- 0xca, 0x6d, 0xf5, 0x9a, 0x1e, 0x9f, 0x37, 0xbe, 0xfe, 0x38, 0x20, 0x22, \
- 0x91, 0x8c, 0xcd, 0x95, 0x02, 0xf2, 0x4d, 0x6f, 0x1a, 0xb4, 0x43, 0xf0, \
- 0x19, 0xdf, 0x65, 0xc0, 0x92, 0xe7, 0x9d, 0x2f, 0x09, 0xe7, 0xec, 0x69, \
- 0xa8, 0xc2, 0x8f, 0x0d \
-}
+/* BEGIN FILE binary macro TEST_CA_KEY_RSA_DER tests/data_files/test-ca.key.der
+ */
+#define TEST_CA_KEY_RSA_DER \
+ { \
+ 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, \
+ 0x00, 0xc0, 0xdf, 0x37, 0xfc, 0x17, 0xbb, 0xe0, 0x96, 0x9d, 0x3f, \
+ 0x86, 0xde, 0x96, 0x32, 0x7d, 0x44, 0xa5, 0x16, 0xa0, 0xcd, 0x21, \
+ 0xf1, 0x99, 0xd4, 0xec, 0xea, 0xcb, 0x7c, 0x18, 0x58, 0x08, 0x94, \
+ 0xa5, 0xec, 0x9b, 0xc5, 0x8b, 0xdf, 0x1a, 0x1e, 0x99, 0x38, 0x99, \
+ 0x87, 0x1e, 0x7b, 0xc0, 0x8d, 0x39, 0xdf, 0x38, 0x5d, 0x70, 0x78, \
+ 0x07, 0xd3, 0x9e, 0xd9, 0x93, 0xe8, 0xb9, 0x72, 0x51, 0xc5, 0xce, \
+ 0xa3, 0x30, 0x52, 0xa9, 0xf2, 0xe7, 0x40, 0x70, 0x14, 0xcb, 0x44, \
+ 0xa2, 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x30, 0x4e, 0x96, 0xbb, 0x26, 0x16, \
+ 0xb9, 0x41, 0x36, 0xfe, 0x8a, 0xd6, 0x53, 0x7c, 0xaa, 0xec, 0x39, \
+ 0x42, 0x50, 0xef, 0xe3, 0xb3, 0x01, 0x28, 0x32, 0xca, 0x6d, 0xf5, \
+ 0x9a, 0x1e, 0x9f, 0x37, 0xbe, 0xfe, 0x38, 0x20, 0x22, 0x91, 0x8c, \
+ 0xcd, 0x95, 0x02, 0xf2, 0x4d, 0x6f, 0x1a, 0xb4, 0x43, 0xf0, 0x19, \
+ 0xdf, 0x65, 0xc0, 0x92, 0xe7, 0x9d, 0x2f, 0x09, 0xe7, 0xec, 0x69, \
+ 0xa8, 0xc2, 0x8f, 0x0d \
+ }
/* END FILE */
/*
@@ -517,55 +559,61 @@
/* END FILE */
/* This is generated from tests/data_files/server5.crt.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_SRV_CRT_EC_DER tests/data_files/server5.crt.der */
-#define TEST_SRV_CRT_EC_DER { \
- 0x30, 0x82, 0x02, 0x1f, 0x30, 0x82, 0x01, 0xa5, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x09, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \
- 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \
- 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, \
- 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \
- 0x31, 0x33, 0x30, 0x39, 0x32, 0x34, 0x31, 0x35, 0x35, 0x32, 0x30, 0x34, \
- 0x5a, 0x17, 0x0d, 0x32, 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x35, \
- 0x32, 0x30, 0x34, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, \
- 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x59, \
- 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, \
- 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, \
- 0x04, 0x37, 0xcc, 0x56, 0xd9, 0x76, 0x09, 0x1e, 0x5a, 0x72, 0x3e, 0xc7, \
- 0x59, 0x2d, 0xff, 0x20, 0x6e, 0xee, 0x7c, 0xf9, 0x06, 0x91, 0x74, 0xd0, \
- 0xad, 0x14, 0xb5, 0xf7, 0x68, 0x22, 0x59, 0x62, 0x92, 0x4e, 0xe5, 0x00, \
- 0xd8, 0x23, 0x11, 0xff, 0xea, 0x2f, 0xd2, 0x34, 0x5d, 0x5d, 0x16, 0xbd, \
- 0x8a, 0x88, 0xc2, 0x6b, 0x77, 0x0d, 0x55, 0xcd, 0x8a, 0x2a, 0x0e, 0xfa, \
- 0x01, 0xc8, 0xb4, 0xed, 0xff, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, 0x30, \
- 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, \
- 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x50, 0x61, 0xa5, \
- 0x8f, 0xd4, 0x07, 0xd9, 0xd7, 0x82, 0x01, 0x0c, 0xe5, 0x65, 0x7f, 0x8c, \
- 0x63, 0x46, 0xa7, 0x13, 0xbe, 0x30, 0x6e, 0x06, 0x03, 0x55, 0x1d, 0x23, \
- 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, 0x01, \
- 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, 0xfb, \
- 0x36, 0x7c, 0xa1, 0x42, 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \
- 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \
- 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
- 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \
- 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, 0x20, \
- 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x82, 0x09, \
- 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, 0x30, 0x0a, 0x06, \
- 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x68, 0x00, \
- 0x30, 0x65, 0x02, 0x31, 0x00, 0x9a, 0x2c, 0x5c, 0xd7, 0xa6, 0xdb, 0xa2, \
- 0xe5, 0x64, 0x0d, 0xf0, 0xb9, 0x4e, 0xdd, 0xd7, 0x61, 0xd6, 0x13, 0x31, \
- 0xc7, 0xab, 0x73, 0x80, 0xbb, 0xd3, 0xd3, 0x73, 0x13, 0x54, 0xad, 0x92, \
- 0x0b, 0x5d, 0xab, 0xd0, 0xbc, 0xf7, 0xae, 0x2f, 0xe6, 0xa1, 0x21, 0x29, \
- 0x35, 0x95, 0xaa, 0x3e, 0x39, 0x02, 0x30, 0x21, 0x36, 0x7f, 0x9d, 0xc6, \
- 0x5d, 0xc6, 0x0b, 0xab, 0x27, 0xf2, 0x25, 0x1d, 0x3b, 0xf1, 0xcf, 0xf1, \
- 0x35, 0x25, 0x14, 0xe7, 0xe5, 0xf1, 0x97, 0xb5, 0x59, 0xe3, 0x5e, 0x15, \
- 0x7c, 0x66, 0xb9, 0x90, 0x7b, 0xc7, 0x01, 0x10, 0x4f, 0x73, 0xc6, 0x00, \
- 0x21, 0x52, 0x2a, 0x0e, 0xf1, 0xc7, 0xd5 \
-}
+/* BEGIN FILE binary macro TEST_SRV_CRT_EC_DER tests/data_files/server5.crt.der
+ */
+#define TEST_SRV_CRT_EC_DER \
+ { \
+ 0x30, 0x82, 0x02, 0x1f, 0x30, 0x82, 0x01, 0xa5, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x09, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, \
+ 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3e, 0x31, 0x0b, 0x30, \
+ 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, \
+ 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, \
+ 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, \
+ 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, \
+ 0x72, 0x73, 0x73, 0x6c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, \
+ 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x33, 0x30, \
+ 0x39, 0x32, 0x34, 0x31, 0x35, 0x35, 0x32, 0x30, 0x34, 0x5a, 0x17, \
+ 0x0d, 0x32, 0x33, 0x30, 0x39, 0x32, 0x32, 0x31, 0x35, 0x35, 0x32, \
+ 0x30, 0x34, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
+ 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, \
+ 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
+ 0x72, 0x53, 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, \
+ 0x04, 0x03, 0x13, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, \
+ 0x73, 0x74, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, \
+ 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
+ 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x37, 0xcc, 0x56, 0xd9, \
+ 0x76, 0x09, 0x1e, 0x5a, 0x72, 0x3e, 0xc7, 0x59, 0x2d, 0xff, 0x20, \
+ 0x6e, 0xee, 0x7c, 0xf9, 0x06, 0x91, 0x74, 0xd0, 0xad, 0x14, 0xb5, \
+ 0xf7, 0x68, 0x22, 0x59, 0x62, 0x92, 0x4e, 0xe5, 0x00, 0xd8, 0x23, \
+ 0x11, 0xff, 0xea, 0x2f, 0xd2, 0x34, 0x5d, 0x5d, 0x16, 0xbd, 0x8a, \
+ 0x88, 0xc2, 0x6b, 0x77, 0x0d, 0x55, 0xcd, 0x8a, 0x2a, 0x0e, 0xfa, \
+ 0x01, 0xc8, 0xb4, 0xed, 0xff, 0xa3, 0x81, 0x9d, 0x30, 0x81, 0x9a, \
+ 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, \
+ 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, \
+ 0x50, 0x61, 0xa5, 0x8f, 0xd4, 0x07, 0xd9, 0xd7, 0x82, 0x01, 0x0c, \
+ 0xe5, 0x65, 0x7f, 0x8c, 0x63, 0x46, 0xa7, 0x13, 0xbe, 0x30, 0x6e, \
+ 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x67, 0x30, 0x65, 0x80, 0x14, \
+ 0x9d, 0x6d, 0x20, 0x24, 0x49, 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, \
+ 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, 0xfb, 0x36, 0x7c, 0xa1, 0x42, \
+ 0xa4, 0x40, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, \
+ 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
+ 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, \
+ 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \
+ 0x03, 0x13, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x73, 0x73, 0x6c, \
+ 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, \
+ 0x82, 0x09, 0x00, 0xc1, 0x43, 0xe2, 0x7e, 0x62, 0x43, 0xcc, 0xe8, \
+ 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, \
+ 0x02, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, 0x00, 0x9a, 0x2c, \
+ 0x5c, 0xd7, 0xa6, 0xdb, 0xa2, 0xe5, 0x64, 0x0d, 0xf0, 0xb9, 0x4e, \
+ 0xdd, 0xd7, 0x61, 0xd6, 0x13, 0x31, 0xc7, 0xab, 0x73, 0x80, 0xbb, \
+ 0xd3, 0xd3, 0x73, 0x13, 0x54, 0xad, 0x92, 0x0b, 0x5d, 0xab, 0xd0, \
+ 0xbc, 0xf7, 0xae, 0x2f, 0xe6, 0xa1, 0x21, 0x29, 0x35, 0x95, 0xaa, \
+ 0x3e, 0x39, 0x02, 0x30, 0x21, 0x36, 0x7f, 0x9d, 0xc6, 0x5d, 0xc6, \
+ 0x0b, 0xab, 0x27, 0xf2, 0x25, 0x1d, 0x3b, 0xf1, 0xcf, 0xf1, 0x35, \
+ 0x25, 0x14, 0xe7, 0xe5, 0xf1, 0x97, 0xb5, 0x59, 0xe3, 0x5e, 0x15, \
+ 0x7c, 0x66, 0xb9, 0x90, 0x7b, 0xc7, 0x01, 0x10, 0x4f, 0x73, 0xc6, \
+ 0x00, 0x21, 0x52, 0x2a, 0x0e, 0xf1, 0xc7, 0xd5 \
+ }
/* END FILE */
/* This is taken from tests/data_files/server5.key. */
@@ -579,24 +627,27 @@
/* END FILE */
/* This is generated from tests/data_files/server5.key.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_SRV_KEY_EC_DER tests/data_files/server5.key.der */
-#define TEST_SRV_KEY_EC_DER { \
- 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf1, 0x2a, 0x13, 0x20, 0x76, \
- 0x02, 0x70, 0xa8, 0x3c, 0xbf, 0xfd, 0x53, 0xf6, 0x03, 0x1e, 0xf7, 0x6a, \
- 0x5d, 0x86, 0xc8, 0xa2, 0x04, 0xf2, 0xc3, 0x0c, 0xa9, 0xeb, 0xf5, 0x1f, \
- 0x0f, 0x0e, 0xa7, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
- 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x37, 0xcc, 0x56, \
- 0xd9, 0x76, 0x09, 0x1e, 0x5a, 0x72, 0x3e, 0xc7, 0x59, 0x2d, 0xff, 0x20, \
- 0x6e, 0xee, 0x7c, 0xf9, 0x06, 0x91, 0x74, 0xd0, 0xad, 0x14, 0xb5, 0xf7, \
- 0x68, 0x22, 0x59, 0x62, 0x92, 0x4e, 0xe5, 0x00, 0xd8, 0x23, 0x11, 0xff, \
- 0xea, 0x2f, 0xd2, 0x34, 0x5d, 0x5d, 0x16, 0xbd, 0x8a, 0x88, 0xc2, 0x6b, \
- 0x77, 0x0d, 0x55, 0xcd, 0x8a, 0x2a, 0x0e, 0xfa, 0x01, 0xc8, 0xb4, 0xed, \
- 0xff \
-}
+/* BEGIN FILE binary macro TEST_SRV_KEY_EC_DER tests/data_files/server5.key.der
+ */
+#define TEST_SRV_KEY_EC_DER \
+ { \
+ 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf1, 0x2a, 0x13, 0x20, \
+ 0x76, 0x02, 0x70, 0xa8, 0x3c, 0xbf, 0xfd, 0x53, 0xf6, 0x03, 0x1e, \
+ 0xf7, 0x6a, 0x5d, 0x86, 0xc8, 0xa2, 0x04, 0xf2, 0xc3, 0x0c, 0xa9, \
+ 0xeb, 0xf5, 0x1f, 0x0f, 0x0e, 0xa7, 0xa0, 0x0a, 0x06, 0x08, 0x2a, \
+ 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, \
+ 0x00, 0x04, 0x37, 0xcc, 0x56, 0xd9, 0x76, 0x09, 0x1e, 0x5a, 0x72, \
+ 0x3e, 0xc7, 0x59, 0x2d, 0xff, 0x20, 0x6e, 0xee, 0x7c, 0xf9, 0x06, \
+ 0x91, 0x74, 0xd0, 0xad, 0x14, 0xb5, 0xf7, 0x68, 0x22, 0x59, 0x62, \
+ 0x92, 0x4e, 0xe5, 0x00, 0xd8, 0x23, 0x11, 0xff, 0xea, 0x2f, 0xd2, \
+ 0x34, 0x5d, 0x5d, 0x16, 0xbd, 0x8a, 0x88, 0xc2, 0x6b, 0x77, 0x0d, \
+ 0x55, 0xcd, 0x8a, 0x2a, 0x0e, 0xfa, 0x01, 0xc8, 0xb4, 0xed, 0xff \
+ }
/* END FILE */
/* This is taken from tests/data_files/server2-sha256.crt. */
-/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA256_PEM tests/data_files/server2-sha256.crt */
+/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA256_PEM
+ * tests/data_files/server2-sha256.crt */
#define TEST_SRV_CRT_RSA_SHA256_PEM \
"-----BEGIN CERTIFICATE-----\r\n" \
"MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \
@@ -621,178 +672,197 @@
/* END FILE */
/* This is taken from tests/data_files/server2-sha256.crt.der. */
-/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA256_DER tests/data_files/server2-sha256.crt.der */
-#define TEST_SRV_CRT_RSA_SHA256_DER { \
- 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \
- 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \
- 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
- 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \
- 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
- 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \
- 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \
- 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \
- 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \
- 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \
- 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \
- 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \
- 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, \
- 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, \
- 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, \
- 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, \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 0xc4, 0x02, 0x3c, 0x9a, \
- 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \
- 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \
- 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \
- 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \
- 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \
- 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \
- 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \
- 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \
- 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \
- 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, \
- 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x2e, 0x3a, 0xe4, 0x52, 0x61, \
- 0x3e, 0xa7, 0xa5, 0xef, 0x32, 0x67, 0x80, 0x72, 0x07, 0x26, 0xba, 0xa3, \
- 0xff, 0x05, 0x40, 0xc4, 0x60, 0x05, 0x39, 0x31, 0x77, 0xf7, 0xa5, 0xca, \
- 0x01, 0x31, 0x80, 0xa7, 0xe1, 0xd1, 0x0a, 0xa2, 0x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, 0x84, 0x75, 0xc7, 0xec, 0x00, 0x12, 0xfc, 0x7a, 0x4a, \
- 0x0b, 0x82, 0x07, 0xec, 0x6d, 0x86, 0x02, 0x4d, 0xfe, 0x9f, 0xc8, 0x92, \
- 0x48, 0xde, 0xf5, 0xb1, 0x9c, 0xe9, 0xc6, 0x89, 0xd0, 0xc1, 0x56, 0xe8, \
- 0xa4, 0xc6, 0x6a, 0x2e, 0x66, 0xc1, 0x9b, 0xfe, 0xd6, 0x3c, 0xb7 \
-}
+/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA256_DER
+ * tests/data_files/server2-sha256.crt.der */
+#define TEST_SRV_CRT_RSA_SHA256_DER \
+ { \
+ 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, \
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, \
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, \
+ 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \
+ 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, \
+ 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x10, 0x50, \
+ 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, \
+ 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, \
+ 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, 0x5a, 0x17, \
+ 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34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c6, 0x6a, 0x2e, 0x66, 0xc1, 0x9b, 0xfe, 0xd6, \
+ 0x3c, 0xb7 \
+ }
/* END FILE */
/* This is taken from tests/data_files/server2.crt. */
-/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA1_PEM tests/data_files/server2.crt */
-#define TEST_SRV_CRT_RSA_SHA1_PEM \
-"-----BEGIN CERTIFICATE-----\r\n" \
-"MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \
-"MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \
-"MTkwMjEwMTQ0NDA2WhcNMjkwMjEwMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \
-"A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" \
-"AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" \
-"owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" \
-"NtSj+uGxdtiQwWG0ZlI2oiZTqqt0Xgd9GYLbKtgfoNkNHC1JZvdbJXNG6AuKT2kM\r\n" \
-"tQCQ4dqCEGZ9rlQri2V5kaHiYcPNQEkI7mgM8YuG0ka/0LiqEQMef1aoGh5EGA8P\r\n" \
-"hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" \
-"HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" \
-"VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" \
-"FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQEFBQADggEBAJklg3Q4\r\n" \
-"cB7v7BzsxM/vLyKccO6op0/gZzM4ghuLq2Y32kl0sM6kSNUUmduuq3u/+GmUZN2A\r\n" \
-"O/7c+Hw7hDFEIvZk98aBGjCLqn3DmgHIv8ToQ67nellQxx2Uj309PdgjNi/r9HOc\r\n" \
-"KNAYPbBcg6MJGWWj2TI6vNaceios/DhOYx5V0j5nfqSJ/pnU0g9Ign2LAhgYpGJE\r\n" \
-"iEM9wW7hEMkwmk0h/sqZsrJsGH5YsF/VThSq/JVO1e2mZH2vruyZKJVBq+8tDNYp\r\n" \
-"HkK6tSyVYQhzIt3StMJWKMl/o5k2AYz6tSC164+1oG+ML3LWg8XrGKa91H4UOKap\r\n" \
-"Awgk0+4m0T25cNs=\r\n" \
-"-----END CERTIFICATE-----\r\n"
+/* BEGIN FILE string macro TEST_SRV_CRT_RSA_SHA1_PEM
+ * tests/data_files/server2.crt */
+#define TEST_SRV_CRT_RSA_SHA1_PEM \
+ "-----BEGIN CERTIFICATE-----\r\n" \
+ "MIIDNzCCAh+gAwIBAgIBAjANBgkqhkiG9w0BAQUFADA7MQswCQYDVQQGEwJOTDER\r\n" \
+ "MA8GA1UECgwIUG9sYXJTU0wxGTAXBgNVBAMMEFBvbGFyU1NMIFRlc3QgQ0EwHhcN\r\n" \
+ "MTkwMjEwMTQ0NDA2WhcNMjkwMjEwMTQ0NDA2WjA0MQswCQYDVQQGEwJOTDERMA8G\r\n" \
+ "A1UECgwIUG9sYXJTU0wxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN\r\n" \
+ "AQEBBQADggEPADCCAQoCggEBAMFNo93nzR3RBNdJcriZrA545Do8Ss86ExbQWuTN\r\n" \
+ "owCIp+4ea5anUrSQ7y1yej4kmvy2NKwk9XfgJmSMnLAofaHa6ozmyRyWvP7BBFKz\r\n" \
+ "NtSj+uGxdtiQwWG0ZlI2oiZTqqt0Xgd9GYLbKtgfoNkNHC1JZvdbJXNG6AuKT2kM\r\n" \
+ "tQCQ4dqCEGZ9rlQri2V5kaHiYcPNQEkI7mgM8YuG0ka/0LiqEQMef1aoGh5EGA8P\r\n" \
+ "hYvai0Re4hjGYi/HZo36Xdh98yeJKQHFkA4/J/EwyEoO79bex8cna8cFPXrEAjya\r\n" \
+ "HT4P6DSYW8tzS1KW2BGiLICIaTla0w+w3lkvEcf36hIBMJcCAwEAAaNNMEswCQYD\r\n" \
+ "VR0TBAIwADAdBgNVHQ4EFgQUpQXoZLjc32APUBJNYKhkr02LQ5MwHwYDVR0jBBgw\r\n" \
+ "FoAUtFrkpbPe0lL2udWmlQ/rPrzH/f8wDQYJKoZIhvcNAQEFBQADggEBAJklg3Q4\r\n" \
+ "cB7v7BzsxM/vLyKccO6op0/gZzM4ghuLq2Y32kl0sM6kSNUUmduuq3u/+GmUZN2A\r\n" \
+ "O/7c+Hw7hDFEIvZk98aBGjCLqn3DmgHIv8ToQ67nellQxx2Uj309PdgjNi/r9HOc\r\n" \
+ "KNAYPbBcg6MJGWWj2TI6vNaceios/DhOYx5V0j5nfqSJ/pnU0g9Ign2LAhgYpGJE\r\n" \
+ "iEM9wW7hEMkwmk0h/sqZsrJsGH5YsF/VThSq/JVO1e2mZH2vruyZKJVBq+8tDNYp\r\n" \
+ "HkK6tSyVYQhzIt3StMJWKMl/o5k2AYz6tSC164+1oG+ML3LWg8XrGKa91H4UOKap\r\n" \
+ "Awgk0+4m0T25cNs=\r\n" \
+ "-----END CERTIFICATE-----\r\n"
/* END FILE */
/* This is taken from tests/data_files/server2.crt.der. */
-/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA1_DER tests/data_files/server2.crt.der */
-#define TEST_SRV_CRT_RSA_SHA1_DER { \
- 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \
- 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \
- 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
- 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \
- 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
- 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \
- 0x31, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \
- 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, \
- 0x34, 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \
- 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x82, \
- 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, \
- 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, \
- 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc1, 0x4d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44, 0x5e, 0xe2, 0x18, 0xc6, 0x62, 0x2f, 0xc7, \
- 0x66, 0x8d, 0xfa, 0x5d, 0xd8, 0x7d, 0xf3, 0x27, 0x89, 0x29, 0x01, 0xc5, \
- 0x90, 0x0e, 0x3f, 0x27, 0xf1, 0x30, 0xc8, 0x4a, 0x0e, 0xef, 0xd6, 0xde, \
- 0xc7, 0xc7, 0x27, 0x6b, 0xc7, 0x05, 0x3d, 0x7a, 0xc4, 0x02, 0x3c, 0x9a, \
- 0x1d, 0x3e, 0x0f, 0xe8, 0x34, 0x98, 0x5b, 0xcb, 0x73, 0x4b, 0x52, 0x96, \
- 0xd8, 0x11, 0xa2, 0x2c, 0x80, 0x88, 0x69, 0x39, 0x5a, 0xd3, 0x0f, 0xb0, \
- 0xde, 0x59, 0x2f, 0x11, 0xc7, 0xf7, 0xea, 0x12, 0x01, 0x30, 0x97, 0x02, \
- 0x03, 0x01, 0x00, 0x01, 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, \
- 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa5, 0x05, 0xe8, 0x64, 0xb8, 0xdc, \
- 0xdf, 0x60, 0x0f, 0x50, 0x12, 0x4d, 0x60, 0xa8, 0x64, 0xaf, 0x4d, 0x8b, \
- 0x43, 0x93, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, \
- 0x16, 0x80, 0x14, 0xb4, 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, \
- 0xb9, 0xd5, 0xa6, 0x95, 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, \
- 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, \
- 0x05, 0x00, 0x03, 0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xcb, 0x0b, 0xd8, 0x0e, 0xc1, 0x90, 0xdf, 0xa1, 0xd2, 0x1a, 0xd1, 0x2c, \
- 0x02, 0xf4, 0x76, 0x41, 0xa4, 0xcb, 0x4b, 0x15, 0x98, 0x71, 0xf9, 0x35, \
- 0x7d, 0xb0, 0xe7, 0xe2, 0x34, 0x96, 0x91, 0xbe, 0x32, 0x67, 0x2d, 0x6b, \
- 0xd3, 0x55, 0x04, 0x8a, 0x01, 0x50, 0xb4, 0xe3, 0x62, 0x78, 0x6c, 0x11, \
- 0x15, 0xa5, 0x2a, 0x11, 0xc1, 0x49, 0x1c, 0x9b, 0xc4, 0x10, 0x65, 0x60, \
- 0x87, 0xd9, 0x1e, 0x69, 0x59, 0x4e, 0x8f, 0x6b, 0xeb, 0xc1, 0xfe, 0x6b, \
- 0xe2, 0x63, 0x78, 0x95, 0x6e, 0xe0, 0x2d, 0xd7, 0xa7, 0x37, 0xa8 \
-}
+/* BEGIN FILE binary macro TEST_SRV_CRT_RSA_SHA1_DER
+ * tests/data_files/server2.crt.der */
+#define TEST_SRV_CRT_RSA_SHA1_DER \
+ { \
+ 0x30, 0x82, 0x03, 0x37, 0x30, 0x82, 0x02, 0x1f, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, \
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, \
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, \
+ 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \
+ 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, \
+ 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x10, 0x50, \
+ 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, \
+ 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30, \
+ 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, 0x5a, 0x17, \
+ 0x0d, 0x32, 0x31, 0x30, 0x32, 0x31, 0x32, 0x31, 0x34, 0x34, 0x34, \
+ 0x30, 0x36, 0x5a, 0x30, 0x34, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
+ 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, \
+ 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
+ 0x72, 0x53, 0x53, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, \
+ 0x04, 0x03, 0x0c, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, \
+ 0x73, 0x74, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, \
+ 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, \
+ 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, \
+ 0x01, 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, 0xcd, 0x1d, 0xd1, 0x04, \
+ 0xd7, 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, 0xe4, 0x3a, 0x3c, \
+ 0x4a, 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, 0xa3, 0x00, \
+ 0x88, 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, 0xef, \
+ 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc,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x55, 0x04, 0x8a, 0x01, 0x50, 0xb4, 0xe3, 0x62, 0x78, 0x6c, 0x11, \
+ 0x15, 0xa5, 0x2a, 0x11, 0xc1, 0x49, 0x1c, 0x9b, 0xc4, 0x10, 0x65, \
+ 0x60, 0x87, 0xd9, 0x1e, 0x69, 0x59, 0x4e, 0x8f, 0x6b, 0xeb, 0xc1, \
+ 0xfe, 0x6b, 0xe2, 0x63, 0x78, 0x95, 0x6e, 0xe0, 0x2d, 0xd7, 0xa7, \
+ 0x37, 0xa8 \
+ }
/* END FILE */
/* This is taken from tests/data_files/server2.key. */
@@ -828,109 +898,120 @@
/* END FILE */
/* This was generated from tests/data_files/server2.key.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_SRV_KEY_RSA_DER tests/data_files/server2.key.der */
-#define TEST_SRV_KEY_RSA_DER { \
- 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \
- 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, 0xcd, 0x1d, 0xd1, 0x04, 0xd7, 0x49, 0x72, \
- 0xb8, 0x99, 0xac, 0x0e, 0x78, 0xe4, 0x3a, 0x3c, 0x4a, 0xcf, 0x3a, 0x13, \
- 0x16, 0xd0, 0x5a, 0xe4, 0xcd, 0xa3, 0x00, 0x88, 0xa7, 0xee, 0x1e, 0x6b, \
- 0x96, 0xa7, 0x52, 0xb4, 0x90, 0xef, 0x2d, 0x72, 0x7a, 0x3e, 0x24, 0x9a, \
- 0xfc, 0xb6, 0x34, 0xac, 0x24, 0xf5, 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, \
- 0xb0, 0x28, 0x7d, 0xa1, 0xda, 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, \
- 0xfe, 0xc1, 0x04, 0x52, 0xb3, 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, \
- 0xd8, 0x90, 0xc1, 0x61, 0xb4, 0x66,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0xe7, \
- 0x65, 0xbf, 0x0b, 0xe6, 0x01, 0xaf, 0x9c, 0x1d, 0x5b, 0x6c, 0x3f, 0x1c, \
- 0x2f, 0xa6, 0x0f, 0x68, 0x38, 0x8e, 0x85, 0xc4, 0x6c, 0x78, 0x2f, 0x6f, \
- 0x06, 0x21, 0x2e, 0x56 \
-}
+/* BEGIN FILE binary macro TEST_SRV_KEY_RSA_DER tests/data_files/server2.key.der
+ */
+#define TEST_SRV_KEY_RSA_DER \
+ { \
+ 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, \
+ 0x00, 0xc1, 0x4d, 0xa3, 0xdd, 0xe7, 0xcd, 0x1d, 0xd1, 0x04, 0xd7, \
+ 0x49, 0x72, 0xb8, 0x99, 0xac, 0x0e, 0x78, 0xe4, 0x3a, 0x3c, 0x4a, \
+ 0xcf, 0x3a, 0x13, 0x16, 0xd0, 0x5a, 0xe4, 0xcd, 0xa3, 0x00, 0x88, \
+ 0xa7, 0xee, 0x1e, 0x6b, 0x96, 0xa7, 0x52, 0xb4, 0x90, 0xef, 0x2d, \
+ 0x72, 0x7a, 0x3e, 0x24, 0x9a, 0xfc, 0xb6, 0x34, 0xac, 0x24, 0xf5, \
+ 0x77, 0xe0, 0x26, 0x64, 0x8c, 0x9c, 0xb0, 0x28, 0x7d, 0xa1, 0xda, \
+ 0xea, 0x8c, 0xe6, 0xc9, 0x1c, 0x96, 0xbc, 0xfe, 0xc1, 0x04, 0x52, \
+ 0xb3, 0x36, 0xd4, 0xa3, 0xfa, 0xe1, 0xb1, 0x76, 0xd8, 0x90, 0xc1, \
+ 0x61, 0xb4, 0x66, 0x52, 0x36, 0xa2, 0x26, 0x53, 0xaa, 0xab, 0x74, \
+ 0x5e, 0x07, 0x7d, 0x19, 0x82, 0xdb, 0x2a, 0xd8, 0x1f, 0xa0, 0xd9, \
+ 0x0d, 0x1c, 0x2d, 0x49, 0x66, 0xf7, 0x5b, 0x25, 0x73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, 0x9c, 0x1d, 0x5b, 0x6c, 0x3f, 0x1c, 0x2f, \
+ 0xa6, 0x0f, 0x68, 0x38, 0x8e, 0x85, 0xc4, 0x6c, 0x78, 0x2f, 0x6f, \
+ 0x06, 0x21, 0x2e, 0x56 \
+ }
/* END FILE */
/*
@@ -960,55 +1041,59 @@
"IwQYMBaAFJ1tICRJAT8ry3i1Gbx+JMnb+zZ8MAwGCCqGSM49BAMCBQADaAAwZQIx\r\n" \
"AMqme4DKMldUlplDET9Q6Eptre7uUWKhsLOF+zPkKDlfzpIkJYEFgcloDHGYw80u\r\n" \
"IgIwNftyPXsabTqMM7iEHgVpX/GRozKklY9yQI/5eoA6gGW7Y+imuGR/oao5ySOb\r\n" \
- "a9Vk\r\n" \
+ "a9Vk\r\n" \
"-----END CERTIFICATE-----\r\n"
/* END FILE */
/* This is generated from tests/data_files/cli2.crt.der using `xxd -i`. */
/* BEGIN FILE binary macro TEST_CLI_CRT_EC_DER tests/data_files/cli2.crt.der */
-#define TEST_CLI_CRT_EC_DER { \
- 0x30, 0x82, 0x01, 0xdf, 0x30, 0x82, 0x01, 0x63, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x0d, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, \
- 0x3d, 0x04, 0x03, 0x02, 0x05, 0x00, 0x30, 0x3e, 0x31, 0x0b, 0x30, 0x09, \
- 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \
- 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
- 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, \
- 0x03, 0x0c, 0x13, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, \
- 0x54, 0x65, 0x73, 0x74, 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, \
- 0x17, 0x0d, 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, \
- 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, \
- 0x34, 0x34, 0x34, 0x30, 0x30, 0x5a, 0x30, 0x41, 0x31, 0x0b, 0x30, 0x09, \
- 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, \
- 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
- 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, \
- 0x03, 0x0c, 0x16, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, \
- 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, \
- 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
- 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, \
- 0x03, 0x42, 0x00, 0x04, 0x57, 0xe5, 0xae, 0xb1, 0x73, 0xdf, 0xd3, 0xac, \
- 0xbb, 0x93, 0xb8, 0x81, 0xff, 0x12, 0xae, 0xee, 0xe6, 0x53, 0xac, 0xce, \
- 0x55, 0x53, 0xf6, 0x34, 0x0e, 0xcc, 0x2e, 0xe3, 0x63, 0x25, 0x0b, 0xdf, \
- 0x98, 0xe2, 0xf3, 0x5c, 0x60, 0x36, 0x96, 0xc0, 0xd5, 0x18, 0x14, 0x70, \
- 0xe5, 0x7f, 0x9f, 0xd5, 0x4b, 0x45, 0x18, 0xe5, 0xb0, 0x6c, 0xd5, 0x5c, \
- 0xf8, 0x96, 0x8f, 0x87, 0x70, 0xa3, 0xe4, 0xc7, 0xa3, 0x4d, 0x30, 0x4b, \
- 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, \
- 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x7a, 0x00, \
- 0x5f, 0x86, 0x64, 0xfc, 0xe0, 0x5d, 0xe5, 0x11, 0x10, 0x3b, 0xb2, 0xe6, \
- 0x3b, 0xc4, 0x26, 0x3f, 0xcf, 0xe2, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, \
- 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, \
- 0x01, 0x3f, 0x2b, 0xcb, 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, \
- 0xfb, 0x36, 0x7c, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
- 0x04, 0x03, 0x02, 0x05, 0x00, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, \
- 0x00, 0xca, 0xa6, 0x7b, 0x80, 0xca, 0x32, 0x57, 0x54, 0x96, 0x99, 0x43, \
- 0x11, 0x3f, 0x50, 0xe8, 0x4a, 0x6d, 0xad, 0xee, 0xee, 0x51, 0x62, 0xa1, \
- 0xb0, 0xb3, 0x85, 0xfb, 0x33, 0xe4, 0x28, 0x39, 0x5f, 0xce, 0x92, 0x24, \
- 0x25, 0x81, 0x05, 0x81, 0xc9, 0x68, 0x0c, 0x71, 0x98, 0xc3, 0xcd, 0x2e, \
- 0x22, 0x02, 0x30, 0x35, 0xfb, 0x72, 0x3d, 0x7b, 0x1a, 0x6d, 0x3a, 0x8c, \
- 0x33, 0xb8, 0x84, 0x1e, 0x05, 0x69, 0x5f, 0xf1, 0x91, 0xa3, 0x32, 0xa4, \
- 0x95, 0x8f, 0x72, 0x40, 0x8f, 0xf9, 0x7a, 0x80, 0x3a, 0x80, 0x65, 0xbb, \
- 0x63, 0xe8, 0xa6, 0xb8, 0x64, 0x7f, 0xa1, 0xaa, 0x39, 0xc9, 0x23, 0x9b, \
- 0x6b, 0xd5, 0x64 \
-}
+#define TEST_CLI_CRT_EC_DER \
+ { \
+ 0x30, 0x82, 0x01, 0xdf, 0x30, 0x82, 0x01, 0x63, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x0d, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, \
+ 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x05, 0x00, 0x30, 0x3e, 0x31, \
+ 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, \
+ 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, \
+ 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1c, \
+ 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x13, 0x50, 0x6f, \
+ 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, 0x74, \
+ 0x20, 0x45, 0x43, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, \
+ 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x30, \
+ 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, \
+ 0x34, 0x34, 0x30, 0x30, 0x5a, 0x30, 0x41, 0x31, 0x0b, 0x30, 0x09, \
+ 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
+ 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, \
+ 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1f, 0x30, 0x1d, 0x06, \
+ 0x03, 0x55, 0x04, 0x03, 0x0c, 0x16, 0x50, 0x6f, 0x6c, 0x61, 0x72, \
+ 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x6c, \
+ 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, 0x59, 0x30, 0x13, 0x06, \
+ 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, \
+ 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, \
+ 0x57, 0xe5, 0xae, 0xb1, 0x73, 0xdf, 0xd3, 0xac, 0xbb, 0x93, 0xb8, \
+ 0x81, 0xff, 0x12, 0xae, 0xee, 0xe6, 0x53, 0xac, 0xce, 0x55, 0x53, \
+ 0xf6, 0x34, 0x0e, 0xcc, 0x2e, 0xe3, 0x63, 0x25, 0x0b, 0xdf, 0x98, \
+ 0xe2, 0xf3, 0x5c, 0x60, 0x36, 0x96, 0xc0, 0xd5, 0x18, 0x14, 0x70, \
+ 0xe5, 0x7f, 0x9f, 0xd5, 0x4b, 0x45, 0x18, 0xe5, 0xb0, 0x6c, 0xd5, \
+ 0x5c, 0xf8, 0x96, 0x8f, 0x87, 0x70, 0xa3, 0xe4, 0xc7, 0xa3, 0x4d, \
+ 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x02, \
+ 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, \
+ 0x04, 0x14, 0x7a, 0x00, 0x5f, 0x86, 0x64, 0xfc, 0xe0, 0x5d, 0xe5, \
+ 0x11, 0x10, 0x3b, 0xb2, 0xe6, 0x3b, 0xc4, 0x26, 0x3f, 0xcf, 0xe2, \
+ 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, \
+ 0x80, 0x14, 0x9d, 0x6d, 0x20, 0x24, 0x49, 0x01, 0x3f, 0x2b, 0xcb, \
+ 0x78, 0xb5, 0x19, 0xbc, 0x7e, 0x24, 0xc9, 0xdb, 0xfb, 0x36, 0x7c, \
+ 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, \
+ 0x02, 0x05, 0x00, 0x03, 0x68, 0x00, 0x30, 0x65, 0x02, 0x31, 0x00, \
+ 0xca, 0xa6, 0x7b, 0x80, 0xca, 0x32, 0x57, 0x54, 0x96, 0x99, 0x43, \
+ 0x11, 0x3f, 0x50, 0xe8, 0x4a, 0x6d, 0xad, 0xee, 0xee, 0x51, 0x62, \
+ 0xa1, 0xb0, 0xb3, 0x85, 0xfb, 0x33, 0xe4, 0x28, 0x39, 0x5f, 0xce, \
+ 0x92, 0x24, 0x25, 0x81, 0x05, 0x81, 0xc9, 0x68, 0x0c, 0x71, 0x98, \
+ 0xc3, 0xcd, 0x2e, 0x22, 0x02, 0x30, 0x35, 0xfb, 0x72, 0x3d, 0x7b, \
+ 0x1a, 0x6d, 0x3a, 0x8c, 0x33, 0xb8, 0x84, 0x1e, 0x05, 0x69, 0x5f, \
+ 0xf1, 0x91, 0xa3, 0x32, 0xa4, 0x95, 0x8f, 0x72, 0x40, 0x8f, 0xf9, \
+ 0x7a, 0x80, 0x3a, 0x80, 0x65, 0xbb, 0x63, 0xe8, 0xa6, 0xb8, 0x64, \
+ 0x7f, 0xa1, 0xaa, 0x39, 0xc9, 0x23, 0x9b, 0x6b, 0xd5, 0x64 \
+ }
/* END FILE */
/* This is taken from tests/data_files/cli2.key. */
@@ -1023,23 +1108,25 @@
/* This is generated from tests/data_files/cli2.key.der using `xxd -i`. */
/* BEGIN FILE binary macro TEST_CLI_KEY_EC_DER tests/data_files/cli2.key.der */
-#define TEST_CLI_KEY_EC_DER { \
- 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf6, 0xf7, 0x86, 0x64, 0xf1, \
- 0x67, 0x7f, 0xe6, 0x64, 0x8d, 0xef, 0xca, 0x4e, 0xe9, 0xdd, 0x4d, 0xf0, \
- 0x05, 0xff, 0x96, 0x22, 0x8a, 0x7a, 0x84, 0x38, 0x64, 0x17, 0x32, 0x61, \
- 0x98, 0xb7, 0x2a, 0xa0, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, \
- 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x57, 0xe5, 0xae, \
- 0xb1, 0x73, 0xdf, 0xd3, 0xac, 0xbb, 0x93, 0xb8, 0x81, 0xff, 0x12, 0xae, \
- 0xee, 0xe6, 0x53, 0xac, 0xce, 0x55, 0x53, 0xf6, 0x34, 0x0e, 0xcc, 0x2e, \
- 0xe3, 0x63, 0x25, 0x0b, 0xdf, 0x98, 0xe2, 0xf3, 0x5c, 0x60, 0x36, 0x96, \
- 0xc0, 0xd5, 0x18, 0x14, 0x70, 0xe5, 0x7f, 0x9f, 0xd5, 0x4b, 0x45, 0x18, \
- 0xe5, 0xb0, 0x6c, 0xd5, 0x5c, 0xf8, 0x96, 0x8f, 0x87, 0x70, 0xa3, 0xe4, \
- 0xc7 \
-}
+#define TEST_CLI_KEY_EC_DER \
+ { \
+ 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xf6, 0xf7, 0x86, 0x64, \
+ 0xf1, 0x67, 0x7f, 0xe6, 0x64, 0x8d, 0xef, 0xca, 0x4e, 0xe9, 0xdd, \
+ 0x4d, 0xf0, 0x05, 0xff, 0x96, 0x22, 0x8a, 0x7a, 0x84, 0x38, 0x64, \
+ 0x17, 0x32, 0x61, 0x98, 0xb7, 0x2a, 0xa0, 0x0a, 0x06, 0x08, 0x2a, \
+ 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0xa1, 0x44, 0x03, 0x42, \
+ 0x00, 0x04, 0x57, 0xe5, 0xae, 0xb1, 0x73, 0xdf, 0xd3, 0xac, 0xbb, \
+ 0x93, 0xb8, 0x81, 0xff, 0x12, 0xae, 0xee, 0xe6, 0x53, 0xac, 0xce, \
+ 0x55, 0x53, 0xf6, 0x34, 0x0e, 0xcc, 0x2e, 0xe3, 0x63, 0x25, 0x0b, \
+ 0xdf, 0x98, 0xe2, 0xf3, 0x5c, 0x60, 0x36, 0x96, 0xc0, 0xd5, 0x18, \
+ 0x14, 0x70, 0xe5, 0x7f, 0x9f, 0xd5, 0x4b, 0x45, 0x18, 0xe5, 0xb0, \
+ 0x6c, 0xd5, 0x5c, 0xf8, 0x96, 0x8f, 0x87, 0x70, 0xa3, 0xe4, 0xc7 \
+ }
/* END FILE */
/* This is taken from tests/data_files/cli-rsa-sha256.crt. */
-/* BEGIN FILE string macro TEST_CLI_CRT_RSA_PEM tests/data_files/cli-rsa-sha256.crt */
+/* BEGIN FILE string macro TEST_CLI_CRT_RSA_PEM
+ * tests/data_files/cli-rsa-sha256.crt */
#define TEST_CLI_CRT_RSA_PEM \
"-----BEGIN CERTIFICATE-----\r\n" \
"MIIDPzCCAiegAwIBAgIBBDANBgkqhkiG9w0BAQsFADA7MQswCQYDVQQGEwJOTDER\r\n" \
@@ -1065,79 +1152,87 @@
/* This was generated from tests/data_files/cli-rsa-sha256.crt.der
using `xxd -i.` */
-/* BEGIN FILE binary macro TEST_CLI_CRT_RSA_DER tests/data_files/cli-rsa-sha256.crt.der */
-#define TEST_CLI_CRT_RSA_DER { \
- 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0x27, 0xa0, 0x03, 0x02, 0x01, \
- 0x02, 0x02, 0x01, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \
- 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, \
- 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, \
- 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, \
- 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, \
- 0x04, 0x03, 0x0c, 0x10, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, \
- 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, \
- 0x31, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, \
- 0x5a, 0x17, 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, \
- 0x34, 0x30, 0x36, 0x5a, 0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
- 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, \
- 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, \
- 0x53, 0x4c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, \
- 0x11, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6c, \
- 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, \
- 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, \
- 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, \
- 0x01, 0x01, 0x00, 0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 0x34, \
- 0x04, 0x66, 0xc7, 0xee, 0xf9, 0x36, 0x0e, 0x6a, 0x95, 0xf6, 0x09, 0x9a, \
- 0x06, 0x67, 0xf4, 0x65, 0x71, 0xf8, 0xca, 0xa4, 0xb1, 0x25, 0xe0, 0xfe, \
- 0x3c, 0x8b, 0x35, 0x04, 0x67, 0xba, 0xe0, 0x4f, 0x76, 0x85, 0xfc, 0x7f, \
- 0xfc, 0x36, 0x6b, 0xb5, 0xe9, 0xcd, 0x2d, 0x03, 0x62, 0x4e, 0xb3, 0x3d, \
- 0x00, 0xcf, 0xaf, 0x76, 0xa0, 0x69, 0x56, 0x83, 0x6a, 0xd2, 0xa8, 0xd4, \
- 0xe7, 0x50, 0x71, 0xe6, 0xb5, 0x36, 0x05, 0x77, 0x05, 0x6d, 0x7b, 0xc8, \
- 0xe4, 0xc4, 0xfd, 0x4c, 0xd5, 0x21, 0x5f, 0x02, 0x03, 0x01, 0x00, 0x01, \
- 0xa3, 0x4d, 0x30, 0x4b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, \
- 0x02, 0x30, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, \
- 0x04, 0x14, 0x71, 0xa1, 0x00, 0x73, 0x72, 0x40, 0x2f, 0x54, 0x76, 0x5e, \
- 0x33, 0xfc, 0x52, 0x8f, 0xbc, 0xf1, 0xdd, 0x6b, 0x46, 0x21, 0x30, 0x1f, \
- 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xb4, \
- 0x5a, 0xe4, 0xa5, 0xb3, 0xde, 0xd2, 0x52, 0xf6, 0xb9, 0xd5, 0xa6, 0x95, \
- 0x0f, 0xeb, 0x3e, 0xbc, 0xc7, 0xfd, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, \
- 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00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x6e, 0x8b, 0x22, 0xb8, 0x81, \
- 0x90, 0x16, 0x91, 0x0a, 0x04, 0x79, 0x62, 0xff, 0x4b, 0x04, 0xf1, 0x5c, \
- 0x34, 0xeb, 0x69, 0xce, 0xef, 0xcb, 0x6e, 0xb6, 0x3b, 0x40, 0x55, 0xca, \
- 0x24, 0xc2, 0x3e, 0x25, 0x70, 0xee, 0x74, 0x2b, 0x0e, 0x9f, 0xc2, 0x82, \
- 0x9a, 0x20, 0x38, 0x77, 0xa1, 0x26, 0x8a, 0xca, 0x9f, 0x87, 0x75, 0x77, \
- 0xe3, 0xce, 0x65, 0xec, 0x71, 0x10, 0x35, 0xcb, 0xcb, 0x4f, 0x19, 0x43, \
- 0xeb, 0x30, 0xd0, 0xca, 0x2d, 0x3f, 0xca, 0x46, 0x14, 0x61, 0x99, 0x30, \
- 0x41, 0x32, 0xb5, 0x37, 0x63, 0x6f, 0x97 \
-}
+/* BEGIN FILE binary macro TEST_CLI_CRT_RSA_DER
+ * tests/data_files/cli-rsa-sha256.crt.der */
+#define TEST_CLI_CRT_RSA_DER \
+ { \
+ 0x30, 0x82, 0x03, 0x3f, 0x30, 0x82, 0x02, 0x27, 0xa0, 0x03, 0x02, \
+ 0x01, 0x02, 0x02, 0x01, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, \
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x3b, \
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, \
+ 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, \
+ 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x31, \
+ 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x10, 0x50, \
+ 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, 0x4c, 0x20, 0x54, 0x65, 0x73, \
+ 0x74, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x30, \
+ 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, 0x30, 0x36, 0x5a, 0x17, \
+ 0x0d, 0x32, 0x39, 0x30, 0x32, 0x31, 0x30, 0x31, 0x34, 0x34, 0x34, \
+ 0x30, 0x36, 0x5a, 0x30, 0x3c, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, \
+ 0x55, 0x04, 0x06, 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x11, 0x30, 0x0f, \
+ 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x08, 0x50, 0x6f, 0x6c, 0x61, \
+ 0x72, 0x53, 0x53, 0x4c, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, \
+ 0x04, 0x03, 0x0c, 0x11, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x53, 0x53, \
+ 0x4c, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x32, 0x30, \
+ 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, \
+ 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, \
+ 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc8, \
+ 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, 0x45, 0xd9, 0x14, \
+ 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, 0x33, 0xad, \
+ 0x0d, 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, 0xd9, 0xcc, \
+ 0x66, 0x85, 0x07, 0xd5, 0xf8, 0x27, 0xb0, 0x4a, 0x35, 0x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0xee, 0x74, 0x2b, 0x0e, 0x9f, 0xc2, 0x82, \
+ 0x9a, 0x20, 0x38, 0x77, 0xa1, 0x26, 0x8a, 0xca, 0x9f, 0x87, 0x75, \
+ 0x77, 0xe3, 0xce, 0x65, 0xec, 0x71, 0x10, 0x35, 0xcb, 0xcb, 0x4f, \
+ 0x19, 0x43, 0xeb, 0x30, 0xd0, 0xca, 0x2d, 0x3f, 0xca, 0x46, 0x14, \
+ 0x61, 0x99, 0x30, 0x41, 0x32, 0xb5, 0x37, 0x63, 0x6f, 0x97 \
+ }
/* END FILE */
/* This is taken from tests/data_files/cli-rsa.key. */
@@ -1169,112 +1264,123 @@
"gxUwAQKBgQCcU6G2L8AG9d9c0UpOyL1tMvFe5Ttw0KjlQVdsh1MP6yigYo9DYuwu\r\n" \
"bHFVW2r0dBTqegP2/KTOxKzaHfC1qf0RGDsUoJCNJrd1cwoCLG8P2EF4w3OBrKqv\r\n" \
"8u4ytY0F+Vlanj5lm3TaoHSVF1+NWPyOTiwevIECGKwSxvlki4fDAA==\r\n" \
- "-----END RSA PRIVATE KEY-----\r\n"/* END FILE */
+ "-----END RSA PRIVATE KEY-----\r\n" /* END FILE */
/* This was generated from tests/data_files/cli-rsa.key.der using `xxd -i`. */
-/* BEGIN FILE binary macro TEST_CLI_KEY_RSA_DER tests/data_files/cli-rsa.key.der */
-#define TEST_CLI_KEY_RSA_DER { \
- 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, \
- 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, 0x45, 0xd9, 0x14, \
- 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, 0x33, 0xad, 0x0d, \
- 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, 0xd9, 0xcc, 0x66, 0x85, \
- 0x07, 0xd5, 0xf8, 0x27, 0xb0,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 0xea, 0x7a, 0x03, 0xf6, \
- 0xfc, 0xa4, 0xce, 0xc4, 0xac, 0xda, 0x1d, 0xf0, 0xb5, 0xa9, 0xfd, 0x11, \
- 0x18, 0x3b, 0x14, 0xa0, 0x90, 0x8d, 0x26, 0xb7, 0x75, 0x73, 0x0a, 0x02, \
- 0x2c, 0x6f, 0x0f, 0xd8, 0x41, 0x78, 0xc3, 0x73, 0x81, 0xac, 0xaa, 0xaf, \
- 0xf2, 0xee, 0x32, 0xb5, 0x8d, 0x05, 0xf9, 0x59, 0x5a, 0x9e, 0x3e, 0x65, \
- 0x9b, 0x74, 0xda, 0xa0, 0x74, 0x95, 0x17, 0x5f, 0x8d, 0x58, 0xfc, 0x8e, \
- 0x4e, 0x2c, 0x1e, 0xbc, 0x81, 0x02, 0x18, 0xac, 0x12, 0xc6, 0xf9, 0x64, \
- 0x8b, 0x87, 0xc3, 0x00 \
-}
+/* BEGIN FILE binary macro TEST_CLI_KEY_RSA_DER tests/data_files/cli-rsa.key.der
+ */
+#define TEST_CLI_KEY_RSA_DER \
+ { \
+ 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, \
+ 0x00, 0xc8, 0x74, 0xc4, 0xcc, 0xb9, 0xf9, 0xb5, 0x79, 0xe9, 0x45, \
+ 0xd9, 0x14, 0x60, 0xb0, 0x7d, 0xbb, 0x93, 0xf2, 0x6b, 0x1e, 0x9f, \
+ 0x33, 0xad, 0x0d, 0x8f, 0x8a, 0x3c, 0x56, 0x65, 0xe5, 0xdc, 0x44, \
+ 0xd9, 0xcc, 0x66, 0x85, 0x07, 0xd5, 0xf8, 0x27, 0xb0, 0x4a, 0x35, \
+ 0xd0, 0x63, 0x9e, 0x0a, 0x6e, 0x1b, 0xb7, 0xda, 0xf0, 0x7e, 0xab, \
+ 0xee, 0x0c, 0x10, 0x93, 0x86, 0x49, 0x18, 0x34, 0xf3, 0xa8, 0x2a, \
+ 0xd2, 0x57, 0xf5,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, 0xc4, 0xac, 0xda, \
+ 0x1d, 0xf0, 0xb5, 0xa9, 0xfd, 0x11, 0x18, 0x3b, 0x14, 0xa0, 0x90, \
+ 0x8d, 0x26, 0xb7, 0x75, 0x73, 0x0a, 0x02, 0x2c, 0x6f, 0x0f, 0xd8, \
+ 0x41, 0x78, 0xc3, 0x73, 0x81, 0xac, 0xaa, 0xaf, 0xf2, 0xee, 0x32, \
+ 0xb5, 0x8d, 0x05, 0xf9, 0x59, 0x5a, 0x9e, 0x3e, 0x65, 0x9b, 0x74, \
+ 0xda, 0xa0, 0x74, 0x95, 0x17, 0x5f, 0x8d, 0x58, 0xfc, 0x8e, 0x4e, \
+ 0x2c, 0x1e, 0xbc, 0x81, 0x02, 0x18, 0xac, 0x12, 0xc6, 0xf9, 0x64, \
+ 0x8b, 0x87, 0xc3, 0x00 \
+ }
/* END FILE */
/*
@@ -1287,135 +1393,135 @@
* CA
*/
-const char mbedtls_test_ca_crt_ec_pem[] = TEST_CA_CRT_EC_PEM;
-const char mbedtls_test_ca_key_ec_pem[] = TEST_CA_KEY_EC_PEM;
-const char mbedtls_test_ca_pwd_ec_pem[] = TEST_CA_PWD_EC_PEM;
-const char mbedtls_test_ca_key_rsa_pem[] = TEST_CA_KEY_RSA_PEM;
-const char mbedtls_test_ca_pwd_rsa_pem[] = TEST_CA_PWD_RSA_PEM;
-const char mbedtls_test_ca_crt_rsa_sha1_pem[] = TEST_CA_CRT_RSA_SHA1_PEM;
-const char mbedtls_test_ca_crt_rsa_sha256_pem[] = TEST_CA_CRT_RSA_SHA256_PEM;
+const char mbedtls_test_ca_crt_ec_pem[] = TEST_CA_CRT_EC_PEM;
+const char mbedtls_test_ca_key_ec_pem[] = TEST_CA_KEY_EC_PEM;
+const char mbedtls_test_ca_pwd_ec_pem[] = TEST_CA_PWD_EC_PEM;
+const char mbedtls_test_ca_key_rsa_pem[] = TEST_CA_KEY_RSA_PEM;
+const char mbedtls_test_ca_pwd_rsa_pem[] = TEST_CA_PWD_RSA_PEM;
+const char mbedtls_test_ca_crt_rsa_sha1_pem[] = TEST_CA_CRT_RSA_SHA1_PEM;
+const char mbedtls_test_ca_crt_rsa_sha256_pem[] = TEST_CA_CRT_RSA_SHA256_PEM;
-const unsigned char mbedtls_test_ca_crt_ec_der[] = TEST_CA_CRT_EC_DER;
-const unsigned char mbedtls_test_ca_key_ec_der[] = TEST_CA_KEY_EC_DER;
-const unsigned char mbedtls_test_ca_key_rsa_der[] = TEST_CA_KEY_RSA_DER;
-const unsigned char mbedtls_test_ca_crt_rsa_sha1_der[] =
+const unsigned char mbedtls_test_ca_crt_ec_der[] = TEST_CA_CRT_EC_DER;
+const unsigned char mbedtls_test_ca_key_ec_der[] = TEST_CA_KEY_EC_DER;
+const unsigned char mbedtls_test_ca_key_rsa_der[] = TEST_CA_KEY_RSA_DER;
+const unsigned char mbedtls_test_ca_crt_rsa_sha1_der[] =
TEST_CA_CRT_RSA_SHA1_DER;
const unsigned char mbedtls_test_ca_crt_rsa_sha256_der[] =
TEST_CA_CRT_RSA_SHA256_DER;
const size_t mbedtls_test_ca_crt_ec_pem_len =
- sizeof( mbedtls_test_ca_crt_ec_pem );
+ sizeof(mbedtls_test_ca_crt_ec_pem);
const size_t mbedtls_test_ca_key_ec_pem_len =
- sizeof( mbedtls_test_ca_key_ec_pem );
+ sizeof(mbedtls_test_ca_key_ec_pem);
const size_t mbedtls_test_ca_pwd_ec_pem_len =
- sizeof( mbedtls_test_ca_pwd_ec_pem ) - 1;
+ sizeof(mbedtls_test_ca_pwd_ec_pem) - 1;
const size_t mbedtls_test_ca_key_rsa_pem_len =
- sizeof( mbedtls_test_ca_key_rsa_pem );
+ sizeof(mbedtls_test_ca_key_rsa_pem);
const size_t mbedtls_test_ca_pwd_rsa_pem_len =
- sizeof( mbedtls_test_ca_pwd_rsa_pem ) - 1;
+ sizeof(mbedtls_test_ca_pwd_rsa_pem) - 1;
const size_t mbedtls_test_ca_crt_rsa_sha1_pem_len =
- sizeof( mbedtls_test_ca_crt_rsa_sha1_pem );
+ sizeof(mbedtls_test_ca_crt_rsa_sha1_pem);
const size_t mbedtls_test_ca_crt_rsa_sha256_pem_len =
- sizeof( mbedtls_test_ca_crt_rsa_sha256_pem );
+ sizeof(mbedtls_test_ca_crt_rsa_sha256_pem);
const size_t mbedtls_test_ca_crt_ec_der_len =
- sizeof( mbedtls_test_ca_crt_ec_der );
+ sizeof(mbedtls_test_ca_crt_ec_der);
const size_t mbedtls_test_ca_key_ec_der_len =
- sizeof( mbedtls_test_ca_key_ec_der );
+ sizeof(mbedtls_test_ca_key_ec_der);
const size_t mbedtls_test_ca_pwd_ec_der_len = 0;
const size_t mbedtls_test_ca_key_rsa_der_len =
- sizeof( mbedtls_test_ca_key_rsa_der );
+ sizeof(mbedtls_test_ca_key_rsa_der);
const size_t mbedtls_test_ca_pwd_rsa_der_len = 0;
const size_t mbedtls_test_ca_crt_rsa_sha1_der_len =
- sizeof( mbedtls_test_ca_crt_rsa_sha1_der );
+ sizeof(mbedtls_test_ca_crt_rsa_sha1_der);
const size_t mbedtls_test_ca_crt_rsa_sha256_der_len =
- sizeof( mbedtls_test_ca_crt_rsa_sha256_der );
+ sizeof(mbedtls_test_ca_crt_rsa_sha256_der);
/*
* Server
*/
-const char mbedtls_test_srv_crt_ec_pem[] = TEST_SRV_CRT_EC_PEM;
-const char mbedtls_test_srv_key_ec_pem[] = TEST_SRV_KEY_EC_PEM;
-const char mbedtls_test_srv_pwd_ec_pem[] = "";
-const char mbedtls_test_srv_key_rsa_pem[] = TEST_SRV_KEY_RSA_PEM;
-const char mbedtls_test_srv_pwd_rsa_pem[] = "";
-const char mbedtls_test_srv_crt_rsa_sha1_pem[] = TEST_SRV_CRT_RSA_SHA1_PEM;
-const char mbedtls_test_srv_crt_rsa_sha256_pem[] = TEST_SRV_CRT_RSA_SHA256_PEM;
+const char mbedtls_test_srv_crt_ec_pem[] = TEST_SRV_CRT_EC_PEM;
+const char mbedtls_test_srv_key_ec_pem[] = TEST_SRV_KEY_EC_PEM;
+const char mbedtls_test_srv_pwd_ec_pem[] = "";
+const char mbedtls_test_srv_key_rsa_pem[] = TEST_SRV_KEY_RSA_PEM;
+const char mbedtls_test_srv_pwd_rsa_pem[] = "";
+const char mbedtls_test_srv_crt_rsa_sha1_pem[] = TEST_SRV_CRT_RSA_SHA1_PEM;
+const char mbedtls_test_srv_crt_rsa_sha256_pem[] = TEST_SRV_CRT_RSA_SHA256_PEM;
-const unsigned char mbedtls_test_srv_crt_ec_der[] = TEST_SRV_CRT_EC_DER;
-const unsigned char mbedtls_test_srv_key_ec_der[] = TEST_SRV_KEY_EC_DER;
-const unsigned char mbedtls_test_srv_key_rsa_der[] = TEST_SRV_KEY_RSA_DER;
-const unsigned char mbedtls_test_srv_crt_rsa_sha1_der[] =
+const unsigned char mbedtls_test_srv_crt_ec_der[] = TEST_SRV_CRT_EC_DER;
+const unsigned char mbedtls_test_srv_key_ec_der[] = TEST_SRV_KEY_EC_DER;
+const unsigned char mbedtls_test_srv_key_rsa_der[] = TEST_SRV_KEY_RSA_DER;
+const unsigned char mbedtls_test_srv_crt_rsa_sha1_der[] =
TEST_SRV_CRT_RSA_SHA1_DER;
const unsigned char mbedtls_test_srv_crt_rsa_sha256_der[] =
TEST_SRV_CRT_RSA_SHA256_DER;
const size_t mbedtls_test_srv_crt_ec_pem_len =
- sizeof( mbedtls_test_srv_crt_ec_pem );
+ sizeof(mbedtls_test_srv_crt_ec_pem);
const size_t mbedtls_test_srv_key_ec_pem_len =
- sizeof( mbedtls_test_srv_key_ec_pem );
+ sizeof(mbedtls_test_srv_key_ec_pem);
const size_t mbedtls_test_srv_pwd_ec_pem_len =
- sizeof( mbedtls_test_srv_pwd_ec_pem ) - 1;
+ sizeof(mbedtls_test_srv_pwd_ec_pem) - 1;
const size_t mbedtls_test_srv_key_rsa_pem_len =
- sizeof( mbedtls_test_srv_key_rsa_pem );
+ sizeof(mbedtls_test_srv_key_rsa_pem);
const size_t mbedtls_test_srv_pwd_rsa_pem_len =
- sizeof( mbedtls_test_srv_pwd_rsa_pem ) - 1;
+ sizeof(mbedtls_test_srv_pwd_rsa_pem) - 1;
const size_t mbedtls_test_srv_crt_rsa_sha1_pem_len =
- sizeof( mbedtls_test_srv_crt_rsa_sha1_pem );
+ sizeof(mbedtls_test_srv_crt_rsa_sha1_pem);
const size_t mbedtls_test_srv_crt_rsa_sha256_pem_len =
- sizeof( mbedtls_test_srv_crt_rsa_sha256_pem );
+ sizeof(mbedtls_test_srv_crt_rsa_sha256_pem);
const size_t mbedtls_test_srv_crt_ec_der_len =
- sizeof( mbedtls_test_srv_crt_ec_der );
+ sizeof(mbedtls_test_srv_crt_ec_der);
const size_t mbedtls_test_srv_key_ec_der_len =
- sizeof( mbedtls_test_srv_key_ec_der );
+ sizeof(mbedtls_test_srv_key_ec_der);
const size_t mbedtls_test_srv_pwd_ec_der_len = 0;
const size_t mbedtls_test_srv_key_rsa_der_len =
- sizeof( mbedtls_test_srv_key_rsa_der );
+ sizeof(mbedtls_test_srv_key_rsa_der);
const size_t mbedtls_test_srv_pwd_rsa_der_len = 0;
const size_t mbedtls_test_srv_crt_rsa_sha1_der_len =
- sizeof( mbedtls_test_srv_crt_rsa_sha1_der );
+ sizeof(mbedtls_test_srv_crt_rsa_sha1_der);
const size_t mbedtls_test_srv_crt_rsa_sha256_der_len =
- sizeof( mbedtls_test_srv_crt_rsa_sha256_der );
+ sizeof(mbedtls_test_srv_crt_rsa_sha256_der);
/*
* Client
*/
-const char mbedtls_test_cli_crt_ec_pem[] = TEST_CLI_CRT_EC_PEM;
-const char mbedtls_test_cli_key_ec_pem[] = TEST_CLI_KEY_EC_PEM;
-const char mbedtls_test_cli_pwd_ec_pem[] = "";
-const char mbedtls_test_cli_key_rsa_pem[] = TEST_CLI_KEY_RSA_PEM;
-const char mbedtls_test_cli_pwd_rsa_pem[] = "";
-const char mbedtls_test_cli_crt_rsa_pem[] = TEST_CLI_CRT_RSA_PEM;
+const char mbedtls_test_cli_crt_ec_pem[] = TEST_CLI_CRT_EC_PEM;
+const char mbedtls_test_cli_key_ec_pem[] = TEST_CLI_KEY_EC_PEM;
+const char mbedtls_test_cli_pwd_ec_pem[] = "";
+const char mbedtls_test_cli_key_rsa_pem[] = TEST_CLI_KEY_RSA_PEM;
+const char mbedtls_test_cli_pwd_rsa_pem[] = "";
+const char mbedtls_test_cli_crt_rsa_pem[] = TEST_CLI_CRT_RSA_PEM;
-const unsigned char mbedtls_test_cli_crt_ec_der[] = TEST_CLI_CRT_EC_DER;
-const unsigned char mbedtls_test_cli_key_ec_der[] = TEST_CLI_KEY_EC_DER;
-const unsigned char mbedtls_test_cli_key_rsa_der[] = TEST_CLI_KEY_RSA_DER;
-const unsigned char mbedtls_test_cli_crt_rsa_der[] = TEST_CLI_CRT_RSA_DER;
+const unsigned char mbedtls_test_cli_crt_ec_der[] = TEST_CLI_CRT_EC_DER;
+const unsigned char mbedtls_test_cli_key_ec_der[] = TEST_CLI_KEY_EC_DER;
+const unsigned char mbedtls_test_cli_key_rsa_der[] = TEST_CLI_KEY_RSA_DER;
+const unsigned char mbedtls_test_cli_crt_rsa_der[] = TEST_CLI_CRT_RSA_DER;
const size_t mbedtls_test_cli_crt_ec_pem_len =
- sizeof( mbedtls_test_cli_crt_ec_pem );
+ sizeof(mbedtls_test_cli_crt_ec_pem);
const size_t mbedtls_test_cli_key_ec_pem_len =
- sizeof( mbedtls_test_cli_key_ec_pem );
+ sizeof(mbedtls_test_cli_key_ec_pem);
const size_t mbedtls_test_cli_pwd_ec_pem_len =
- sizeof( mbedtls_test_cli_pwd_ec_pem ) - 1;
+ sizeof(mbedtls_test_cli_pwd_ec_pem) - 1;
const size_t mbedtls_test_cli_key_rsa_pem_len =
- sizeof( mbedtls_test_cli_key_rsa_pem );
+ sizeof(mbedtls_test_cli_key_rsa_pem);
const size_t mbedtls_test_cli_pwd_rsa_pem_len =
- sizeof( mbedtls_test_cli_pwd_rsa_pem ) - 1;
+ sizeof(mbedtls_test_cli_pwd_rsa_pem) - 1;
const size_t mbedtls_test_cli_crt_rsa_pem_len =
- sizeof( mbedtls_test_cli_crt_rsa_pem );
+ sizeof(mbedtls_test_cli_crt_rsa_pem);
const size_t mbedtls_test_cli_crt_ec_der_len =
- sizeof( mbedtls_test_cli_crt_ec_der );
+ sizeof(mbedtls_test_cli_crt_ec_der);
const size_t mbedtls_test_cli_key_ec_der_len =
- sizeof( mbedtls_test_cli_key_ec_der );
+ sizeof(mbedtls_test_cli_key_ec_der);
const size_t mbedtls_test_cli_key_rsa_der_len =
- sizeof( mbedtls_test_cli_key_rsa_der );
+ sizeof(mbedtls_test_cli_key_rsa_der);
const size_t mbedtls_test_cli_crt_rsa_der_len =
- sizeof( mbedtls_test_cli_crt_rsa_der );
+ sizeof(mbedtls_test_cli_crt_rsa_der);
/*
*
@@ -1433,151 +1539,135 @@
/* PEM encoded test CA certificates and keys */
-#define TEST_CA_KEY_RSA TEST_CA_KEY_RSA_PEM
-#define TEST_CA_PWD_RSA TEST_CA_PWD_RSA_PEM
-#define TEST_CA_CRT_RSA_SHA256 TEST_CA_CRT_RSA_SHA256_PEM
-#define TEST_CA_CRT_RSA_SHA1 TEST_CA_CRT_RSA_SHA1_PEM
-#define TEST_CA_KEY_EC TEST_CA_KEY_EC_PEM
-#define TEST_CA_PWD_EC TEST_CA_PWD_EC_PEM
-#define TEST_CA_CRT_EC TEST_CA_CRT_EC_PEM
+# define TEST_CA_KEY_RSA TEST_CA_KEY_RSA_PEM
+# define TEST_CA_PWD_RSA TEST_CA_PWD_RSA_PEM
+# define TEST_CA_CRT_RSA_SHA256 TEST_CA_CRT_RSA_SHA256_PEM
+# define TEST_CA_CRT_RSA_SHA1 TEST_CA_CRT_RSA_SHA1_PEM
+# define TEST_CA_KEY_EC TEST_CA_KEY_EC_PEM
+# define TEST_CA_PWD_EC TEST_CA_PWD_EC_PEM
+# define TEST_CA_CRT_EC TEST_CA_CRT_EC_PEM
/* PEM encoded test server certificates and keys */
-#define TEST_SRV_KEY_RSA TEST_SRV_KEY_RSA_PEM
-#define TEST_SRV_PWD_RSA ""
-#define TEST_SRV_CRT_RSA_SHA256 TEST_SRV_CRT_RSA_SHA256_PEM
-#define TEST_SRV_CRT_RSA_SHA1 TEST_SRV_CRT_RSA_SHA1_PEM
-#define TEST_SRV_KEY_EC TEST_SRV_KEY_EC_PEM
-#define TEST_SRV_PWD_EC ""
-#define TEST_SRV_CRT_EC TEST_SRV_CRT_EC_PEM
+# define TEST_SRV_KEY_RSA TEST_SRV_KEY_RSA_PEM
+# define TEST_SRV_PWD_RSA ""
+# define TEST_SRV_CRT_RSA_SHA256 TEST_SRV_CRT_RSA_SHA256_PEM
+# define TEST_SRV_CRT_RSA_SHA1 TEST_SRV_CRT_RSA_SHA1_PEM
+# define TEST_SRV_KEY_EC TEST_SRV_KEY_EC_PEM
+# define TEST_SRV_PWD_EC ""
+# define TEST_SRV_CRT_EC TEST_SRV_CRT_EC_PEM
/* PEM encoded test client certificates and keys */
-#define TEST_CLI_KEY_RSA TEST_CLI_KEY_RSA_PEM
-#define TEST_CLI_PWD_RSA ""
-#define TEST_CLI_CRT_RSA TEST_CLI_CRT_RSA_PEM
-#define TEST_CLI_KEY_EC TEST_CLI_KEY_EC_PEM
-#define TEST_CLI_PWD_EC ""
-#define TEST_CLI_CRT_EC TEST_CLI_CRT_EC_PEM
+# define TEST_CLI_KEY_RSA TEST_CLI_KEY_RSA_PEM
+# define TEST_CLI_PWD_RSA ""
+# define TEST_CLI_CRT_RSA TEST_CLI_CRT_RSA_PEM
+# define TEST_CLI_KEY_EC TEST_CLI_KEY_EC_PEM
+# define TEST_CLI_PWD_EC ""
+# define TEST_CLI_CRT_EC TEST_CLI_CRT_EC_PEM
#else /* MBEDTLS_PEM_PARSE_C */
/* DER encoded test CA certificates and keys */
-#define TEST_CA_KEY_RSA TEST_CA_KEY_RSA_DER
-#define TEST_CA_PWD_RSA ""
-#define TEST_CA_CRT_RSA_SHA256 TEST_CA_CRT_RSA_SHA256_DER
-#define TEST_CA_CRT_RSA_SHA1 TEST_CA_CRT_RSA_SHA1_DER
-#define TEST_CA_KEY_EC TEST_CA_KEY_EC_DER
-#define TEST_CA_PWD_EC ""
-#define TEST_CA_CRT_EC TEST_CA_CRT_EC_DER
+# define TEST_CA_KEY_RSA TEST_CA_KEY_RSA_DER
+# define TEST_CA_PWD_RSA ""
+# define TEST_CA_CRT_RSA_SHA256 TEST_CA_CRT_RSA_SHA256_DER
+# define TEST_CA_CRT_RSA_SHA1 TEST_CA_CRT_RSA_SHA1_DER
+# define TEST_CA_KEY_EC TEST_CA_KEY_EC_DER
+# define TEST_CA_PWD_EC ""
+# define TEST_CA_CRT_EC TEST_CA_CRT_EC_DER
/* DER encoded test server certificates and keys */
-#define TEST_SRV_KEY_RSA TEST_SRV_KEY_RSA_DER
-#define TEST_SRV_PWD_RSA ""
-#define TEST_SRV_CRT_RSA_SHA256 TEST_SRV_CRT_RSA_SHA256_DER
-#define TEST_SRV_CRT_RSA_SHA1 TEST_SRV_CRT_RSA_SHA1_DER
-#define TEST_SRV_KEY_EC TEST_SRV_KEY_EC_DER
-#define TEST_SRV_PWD_EC ""
-#define TEST_SRV_CRT_EC TEST_SRV_CRT_EC_DER
+# define TEST_SRV_KEY_RSA TEST_SRV_KEY_RSA_DER
+# define TEST_SRV_PWD_RSA ""
+# define TEST_SRV_CRT_RSA_SHA256 TEST_SRV_CRT_RSA_SHA256_DER
+# define TEST_SRV_CRT_RSA_SHA1 TEST_SRV_CRT_RSA_SHA1_DER
+# define TEST_SRV_KEY_EC TEST_SRV_KEY_EC_DER
+# define TEST_SRV_PWD_EC ""
+# define TEST_SRV_CRT_EC TEST_SRV_CRT_EC_DER
/* DER encoded test client certificates and keys */
-#define TEST_CLI_KEY_RSA TEST_CLI_KEY_RSA_DER
-#define TEST_CLI_PWD_RSA ""
-#define TEST_CLI_CRT_RSA TEST_CLI_CRT_RSA_DER
-#define TEST_CLI_KEY_EC TEST_CLI_KEY_EC_DER
-#define TEST_CLI_PWD_EC ""
-#define TEST_CLI_CRT_EC TEST_CLI_CRT_EC_DER
+# define TEST_CLI_KEY_RSA TEST_CLI_KEY_RSA_DER
+# define TEST_CLI_PWD_RSA ""
+# define TEST_CLI_CRT_RSA TEST_CLI_CRT_RSA_DER
+# define TEST_CLI_KEY_EC TEST_CLI_KEY_EC_DER
+# define TEST_CLI_PWD_EC ""
+# define TEST_CLI_CRT_EC TEST_CLI_CRT_EC_DER
#endif /* MBEDTLS_PEM_PARSE_C */
-const char mbedtls_test_ca_key_rsa[] = TEST_CA_KEY_RSA;
-const char mbedtls_test_ca_pwd_rsa[] = TEST_CA_PWD_RSA;
-const char mbedtls_test_ca_crt_rsa_sha256[] = TEST_CA_CRT_RSA_SHA256;
-const char mbedtls_test_ca_crt_rsa_sha1[] = TEST_CA_CRT_RSA_SHA1;
-const char mbedtls_test_ca_key_ec[] = TEST_CA_KEY_EC;
-const char mbedtls_test_ca_pwd_ec[] = TEST_CA_PWD_EC;
-const char mbedtls_test_ca_crt_ec[] = TEST_CA_CRT_EC;
+const char mbedtls_test_ca_key_rsa[] = TEST_CA_KEY_RSA;
+const char mbedtls_test_ca_pwd_rsa[] = TEST_CA_PWD_RSA;
+const char mbedtls_test_ca_crt_rsa_sha256[] = TEST_CA_CRT_RSA_SHA256;
+const char mbedtls_test_ca_crt_rsa_sha1[] = TEST_CA_CRT_RSA_SHA1;
+const char mbedtls_test_ca_key_ec[] = TEST_CA_KEY_EC;
+const char mbedtls_test_ca_pwd_ec[] = TEST_CA_PWD_EC;
+const char mbedtls_test_ca_crt_ec[] = TEST_CA_CRT_EC;
-const char mbedtls_test_srv_key_rsa[] = TEST_SRV_KEY_RSA;
-const char mbedtls_test_srv_pwd_rsa[] = TEST_SRV_PWD_RSA;
+const char mbedtls_test_srv_key_rsa[] = TEST_SRV_KEY_RSA;
+const char mbedtls_test_srv_pwd_rsa[] = TEST_SRV_PWD_RSA;
const char mbedtls_test_srv_crt_rsa_sha256[] = TEST_SRV_CRT_RSA_SHA256;
-const char mbedtls_test_srv_crt_rsa_sha1[] = TEST_SRV_CRT_RSA_SHA1;
-const char mbedtls_test_srv_key_ec[] = TEST_SRV_KEY_EC;
-const char mbedtls_test_srv_pwd_ec[] = TEST_SRV_PWD_EC;
-const char mbedtls_test_srv_crt_ec[] = TEST_SRV_CRT_EC;
+const char mbedtls_test_srv_crt_rsa_sha1[] = TEST_SRV_CRT_RSA_SHA1;
+const char mbedtls_test_srv_key_ec[] = TEST_SRV_KEY_EC;
+const char mbedtls_test_srv_pwd_ec[] = TEST_SRV_PWD_EC;
+const char mbedtls_test_srv_crt_ec[] = TEST_SRV_CRT_EC;
-const char mbedtls_test_cli_key_rsa[] = TEST_CLI_KEY_RSA;
-const char mbedtls_test_cli_pwd_rsa[] = TEST_CLI_PWD_RSA;
-const char mbedtls_test_cli_crt_rsa[] = TEST_CLI_CRT_RSA;
-const char mbedtls_test_cli_key_ec[] = TEST_CLI_KEY_EC;
-const char mbedtls_test_cli_pwd_ec[] = TEST_CLI_PWD_EC;
-const char mbedtls_test_cli_crt_ec[] = TEST_CLI_CRT_EC;
+const char mbedtls_test_cli_key_rsa[] = TEST_CLI_KEY_RSA;
+const char mbedtls_test_cli_pwd_rsa[] = TEST_CLI_PWD_RSA;
+const char mbedtls_test_cli_crt_rsa[] = TEST_CLI_CRT_RSA;
+const char mbedtls_test_cli_key_ec[] = TEST_CLI_KEY_EC;
+const char mbedtls_test_cli_pwd_ec[] = TEST_CLI_PWD_EC;
+const char mbedtls_test_cli_crt_ec[] = TEST_CLI_CRT_EC;
-const size_t mbedtls_test_ca_key_rsa_len =
- sizeof( mbedtls_test_ca_key_rsa );
-const size_t mbedtls_test_ca_pwd_rsa_len =
- sizeof( mbedtls_test_ca_pwd_rsa ) - 1;
+const size_t mbedtls_test_ca_key_rsa_len = sizeof(mbedtls_test_ca_key_rsa);
+const size_t mbedtls_test_ca_pwd_rsa_len = sizeof(mbedtls_test_ca_pwd_rsa) - 1;
const size_t mbedtls_test_ca_crt_rsa_sha256_len =
- sizeof( mbedtls_test_ca_crt_rsa_sha256 );
+ sizeof(mbedtls_test_ca_crt_rsa_sha256);
const size_t mbedtls_test_ca_crt_rsa_sha1_len =
- sizeof( mbedtls_test_ca_crt_rsa_sha1 );
-const size_t mbedtls_test_ca_key_ec_len =
- sizeof( mbedtls_test_ca_key_ec );
-const size_t mbedtls_test_ca_pwd_ec_len =
- sizeof( mbedtls_test_ca_pwd_ec ) - 1;
-const size_t mbedtls_test_ca_crt_ec_len =
- sizeof( mbedtls_test_ca_crt_ec );
+ sizeof(mbedtls_test_ca_crt_rsa_sha1);
+const size_t mbedtls_test_ca_key_ec_len = sizeof(mbedtls_test_ca_key_ec);
+const size_t mbedtls_test_ca_pwd_ec_len = sizeof(mbedtls_test_ca_pwd_ec) - 1;
+const size_t mbedtls_test_ca_crt_ec_len = sizeof(mbedtls_test_ca_crt_ec);
-const size_t mbedtls_test_srv_key_rsa_len =
- sizeof( mbedtls_test_srv_key_rsa );
+const size_t mbedtls_test_srv_key_rsa_len = sizeof(mbedtls_test_srv_key_rsa);
const size_t mbedtls_test_srv_pwd_rsa_len =
- sizeof( mbedtls_test_srv_pwd_rsa ) -1;
+ sizeof(mbedtls_test_srv_pwd_rsa) - 1;
const size_t mbedtls_test_srv_crt_rsa_sha256_len =
- sizeof( mbedtls_test_srv_crt_rsa_sha256 );
+ sizeof(mbedtls_test_srv_crt_rsa_sha256);
const size_t mbedtls_test_srv_crt_rsa_sha1_len =
- sizeof( mbedtls_test_srv_crt_rsa_sha1 );
-const size_t mbedtls_test_srv_key_ec_len =
- sizeof( mbedtls_test_srv_key_ec );
-const size_t mbedtls_test_srv_pwd_ec_len =
- sizeof( mbedtls_test_srv_pwd_ec ) - 1;
-const size_t mbedtls_test_srv_crt_ec_len =
- sizeof( mbedtls_test_srv_crt_ec );
+ sizeof(mbedtls_test_srv_crt_rsa_sha1);
+const size_t mbedtls_test_srv_key_ec_len = sizeof(mbedtls_test_srv_key_ec);
+const size_t mbedtls_test_srv_pwd_ec_len = sizeof(mbedtls_test_srv_pwd_ec) - 1;
+const size_t mbedtls_test_srv_crt_ec_len = sizeof(mbedtls_test_srv_crt_ec);
-const size_t mbedtls_test_cli_key_rsa_len =
- sizeof( mbedtls_test_cli_key_rsa );
+const size_t mbedtls_test_cli_key_rsa_len = sizeof(mbedtls_test_cli_key_rsa);
const size_t mbedtls_test_cli_pwd_rsa_len =
- sizeof( mbedtls_test_cli_pwd_rsa ) - 1;
-const size_t mbedtls_test_cli_crt_rsa_len =
- sizeof( mbedtls_test_cli_crt_rsa );
-const size_t mbedtls_test_cli_key_ec_len =
- sizeof( mbedtls_test_cli_key_ec );
-const size_t mbedtls_test_cli_pwd_ec_len =
- sizeof( mbedtls_test_cli_pwd_ec ) - 1;
-const size_t mbedtls_test_cli_crt_ec_len =
- sizeof( mbedtls_test_cli_crt_ec );
+ sizeof(mbedtls_test_cli_pwd_rsa) - 1;
+const size_t mbedtls_test_cli_crt_rsa_len = sizeof(mbedtls_test_cli_crt_rsa);
+const size_t mbedtls_test_cli_key_ec_len = sizeof(mbedtls_test_cli_key_ec);
+const size_t mbedtls_test_cli_pwd_ec_len = sizeof(mbedtls_test_cli_pwd_ec) - 1;
+const size_t mbedtls_test_cli_crt_ec_len = sizeof(mbedtls_test_cli_crt_ec);
/*
* Dispatch between SHA-1 and SHA-256
*/
#if defined(MBEDTLS_SHA256_C)
-#define TEST_CA_CRT_RSA TEST_CA_CRT_RSA_SHA256
-#define TEST_SRV_CRT_RSA TEST_SRV_CRT_RSA_SHA256
+# define TEST_CA_CRT_RSA TEST_CA_CRT_RSA_SHA256
+# define TEST_SRV_CRT_RSA TEST_SRV_CRT_RSA_SHA256
#else
-#define TEST_CA_CRT_RSA TEST_CA_CRT_RSA_SHA1
-#define TEST_SRV_CRT_RSA TEST_SRV_CRT_RSA_SHA1
+# define TEST_CA_CRT_RSA TEST_CA_CRT_RSA_SHA1
+# define TEST_SRV_CRT_RSA TEST_SRV_CRT_RSA_SHA1
#endif /* MBEDTLS_SHA256_C */
-const char mbedtls_test_ca_crt_rsa[] = TEST_CA_CRT_RSA;
+const char mbedtls_test_ca_crt_rsa[] = TEST_CA_CRT_RSA;
const char mbedtls_test_srv_crt_rsa[] = TEST_SRV_CRT_RSA;
-const size_t mbedtls_test_ca_crt_rsa_len =
- sizeof( mbedtls_test_ca_crt_rsa );
-const size_t mbedtls_test_srv_crt_rsa_len =
- sizeof( mbedtls_test_srv_crt_rsa );
+const size_t mbedtls_test_ca_crt_rsa_len = sizeof(mbedtls_test_ca_crt_rsa);
+const size_t mbedtls_test_srv_crt_rsa_len = sizeof(mbedtls_test_srv_crt_rsa);
/*
* Dispatch between RSA and EC
@@ -1585,31 +1675,31 @@
#if defined(MBEDTLS_RSA_C)
-#define TEST_CA_KEY TEST_CA_KEY_RSA
-#define TEST_CA_PWD TEST_CA_PWD_RSA
-#define TEST_CA_CRT TEST_CA_CRT_RSA
+# define TEST_CA_KEY TEST_CA_KEY_RSA
+# define TEST_CA_PWD TEST_CA_PWD_RSA
+# define TEST_CA_CRT TEST_CA_CRT_RSA
-#define TEST_SRV_KEY TEST_SRV_KEY_RSA
-#define TEST_SRV_PWD TEST_SRV_PWD_RSA
-#define TEST_SRV_CRT TEST_SRV_CRT_RSA
+# define TEST_SRV_KEY TEST_SRV_KEY_RSA
+# define TEST_SRV_PWD TEST_SRV_PWD_RSA
+# define TEST_SRV_CRT TEST_SRV_CRT_RSA
-#define TEST_CLI_KEY TEST_CLI_KEY_RSA
-#define TEST_CLI_PWD TEST_CLI_PWD_RSA
-#define TEST_CLI_CRT TEST_CLI_CRT_RSA
+# define TEST_CLI_KEY TEST_CLI_KEY_RSA
+# define TEST_CLI_PWD TEST_CLI_PWD_RSA
+# define TEST_CLI_CRT TEST_CLI_CRT_RSA
#else /* no RSA, so assume ECDSA */
-#define TEST_CA_KEY TEST_CA_KEY_EC
-#define TEST_CA_PWD TEST_CA_PWD_EC
-#define TEST_CA_CRT TEST_CA_CRT_EC
+# define TEST_CA_KEY TEST_CA_KEY_EC
+# define TEST_CA_PWD TEST_CA_PWD_EC
+# define TEST_CA_CRT TEST_CA_CRT_EC
-#define TEST_SRV_KEY TEST_SRV_KEY_EC
-#define TEST_SRV_PWD TEST_SRV_PWD_EC
-#define TEST_SRV_CRT TEST_SRV_CRT_EC
+# define TEST_SRV_KEY TEST_SRV_KEY_EC
+# define TEST_SRV_PWD TEST_SRV_PWD_EC
+# define TEST_SRV_CRT TEST_SRV_CRT_EC
-#define TEST_CLI_KEY TEST_CLI_KEY_EC
-#define TEST_CLI_PWD TEST_CLI_PWD_EC
-#define TEST_CLI_CRT TEST_CLI_CRT_EC
+# define TEST_CLI_KEY TEST_CLI_KEY_EC
+# define TEST_CLI_PWD TEST_CLI_PWD_EC
+# define TEST_CLI_CRT TEST_CLI_CRT_EC
#endif /* MBEDTLS_RSA_C */
/* API stability forces us to declare
@@ -1639,26 +1729,17 @@
const char *mbedtls_test_cli_pwd = test_cli_pwd;
const char *mbedtls_test_cli_crt = test_cli_crt;
-const size_t mbedtls_test_ca_key_len =
- sizeof( test_ca_key );
-const size_t mbedtls_test_ca_pwd_len =
- sizeof( test_ca_pwd ) - 1;
-const size_t mbedtls_test_ca_crt_len =
- sizeof( test_ca_crt );
+const size_t mbedtls_test_ca_key_len = sizeof(test_ca_key);
+const size_t mbedtls_test_ca_pwd_len = sizeof(test_ca_pwd) - 1;
+const size_t mbedtls_test_ca_crt_len = sizeof(test_ca_crt);
-const size_t mbedtls_test_srv_key_len =
- sizeof( test_srv_key );
-const size_t mbedtls_test_srv_pwd_len =
- sizeof( test_srv_pwd ) - 1;
-const size_t mbedtls_test_srv_crt_len =
- sizeof( test_srv_crt );
+const size_t mbedtls_test_srv_key_len = sizeof(test_srv_key);
+const size_t mbedtls_test_srv_pwd_len = sizeof(test_srv_pwd) - 1;
+const size_t mbedtls_test_srv_crt_len = sizeof(test_srv_crt);
-const size_t mbedtls_test_cli_key_len =
- sizeof( test_cli_key );
-const size_t mbedtls_test_cli_pwd_len =
- sizeof( test_cli_pwd ) - 1;
-const size_t mbedtls_test_cli_crt_len =
- sizeof( test_cli_crt );
+const size_t mbedtls_test_cli_key_len = sizeof(test_cli_key);
+const size_t mbedtls_test_cli_pwd_len = sizeof(test_cli_pwd) - 1;
+const size_t mbedtls_test_cli_crt_len = sizeof(test_cli_crt);
/*
*
@@ -1667,7 +1748,7 @@
*/
/* List of CAs in PEM or DER, depending on config */
-const char * mbedtls_test_cas[] = {
+const char *mbedtls_test_cas[] = {
#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA1_C)
mbedtls_test_ca_crt_rsa_sha1,
#endif
@@ -1681,26 +1762,26 @@
};
const size_t mbedtls_test_cas_len[] = {
#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA1_C)
- sizeof( mbedtls_test_ca_crt_rsa_sha1 ),
+ sizeof(mbedtls_test_ca_crt_rsa_sha1),
#endif
#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_SHA256_C)
- sizeof( mbedtls_test_ca_crt_rsa_sha256 ),
+ sizeof(mbedtls_test_ca_crt_rsa_sha256),
#endif
#if defined(MBEDTLS_ECDSA_C)
- sizeof( mbedtls_test_ca_crt_ec ),
+ sizeof(mbedtls_test_ca_crt_ec),
#endif
0
};
/* List of all available CA certificates in DER format */
-const unsigned char * mbedtls_test_cas_der[] = {
+const unsigned char *mbedtls_test_cas_der[] = {
#if defined(MBEDTLS_RSA_C)
-#if defined(MBEDTLS_SHA256_C)
+# if defined(MBEDTLS_SHA256_C)
mbedtls_test_ca_crt_rsa_sha256_der,
-#endif /* MBEDTLS_SHA256_C */
-#if defined(MBEDTLS_SHA1_C)
+# endif /* MBEDTLS_SHA256_C */
+# if defined(MBEDTLS_SHA1_C)
mbedtls_test_ca_crt_rsa_sha1_der,
-#endif /* MBEDTLS_SHA1_C */
+# endif /* MBEDTLS_SHA1_C */
#endif /* MBEDTLS_RSA_C */
#if defined(MBEDTLS_ECDSA_C)
mbedtls_test_ca_crt_ec_der,
@@ -1710,15 +1791,15 @@
const size_t mbedtls_test_cas_der_len[] = {
#if defined(MBEDTLS_RSA_C)
-#if defined(MBEDTLS_SHA256_C)
- sizeof( mbedtls_test_ca_crt_rsa_sha256_der ),
-#endif /* MBEDTLS_SHA256_C */
-#if defined(MBEDTLS_SHA1_C)
- sizeof( mbedtls_test_ca_crt_rsa_sha1_der ),
-#endif /* MBEDTLS_SHA1_C */
+# if defined(MBEDTLS_SHA256_C)
+ sizeof(mbedtls_test_ca_crt_rsa_sha256_der),
+# endif /* MBEDTLS_SHA256_C */
+# if defined(MBEDTLS_SHA1_C)
+ sizeof(mbedtls_test_ca_crt_rsa_sha1_der),
+# endif /* MBEDTLS_SHA1_C */
#endif /* MBEDTLS_RSA_C */
#if defined(MBEDTLS_ECDSA_C)
- sizeof( mbedtls_test_ca_crt_ec_der ),
+ sizeof(mbedtls_test_ca_crt_ec_der),
#endif /* MBEDTLS_ECDSA_C */
0
};
@@ -1726,17 +1807,17 @@
/* Concatenation of all available CA certificates in PEM format */
#if defined(MBEDTLS_PEM_PARSE_C)
const char mbedtls_test_cas_pem[] =
-#if defined(MBEDTLS_RSA_C)
-#if defined(MBEDTLS_SHA256_C)
+# if defined(MBEDTLS_RSA_C)
+# if defined(MBEDTLS_SHA256_C)
TEST_CA_CRT_RSA_SHA256_PEM
-#endif /* MBEDTLS_SHA256_C */
-#if defined(MBEDTLS_SHA1_C)
- TEST_CA_CRT_RSA_SHA1_PEM
-#endif /* MBEDTLS_SHA1_C */
-#endif /* MBEDTLS_RSA_C */
-#if defined(MBEDTLS_ECDSA_C)
- TEST_CA_CRT_EC_PEM
-#endif /* MBEDTLS_ECDSA_C */
+# endif /* MBEDTLS_SHA256_C */
+# if defined(MBEDTLS_SHA1_C)
+ TEST_CA_CRT_RSA_SHA1_PEM
+# endif /* MBEDTLS_SHA1_C */
+# endif /* MBEDTLS_RSA_C */
+# if defined(MBEDTLS_ECDSA_C)
+ TEST_CA_CRT_EC_PEM
+# endif /* MBEDTLS_ECDSA_C */
"";
-const size_t mbedtls_test_cas_pem_len = sizeof( mbedtls_test_cas_pem );
+const size_t mbedtls_test_cas_pem_len = sizeof(mbedtls_test_cas_pem);
#endif /* MBEDTLS_PEM_PARSE_C */
diff --git a/tests/src/drivers/hash.c b/tests/src/drivers/hash.c
index d57ce6c..e23c6fa 100644
--- a/tests/src/drivers/hash.c
+++ b/tests/src/drivers/hash.c
@@ -20,138 +20,121 @@
#include <test/helpers.h>
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "psa_crypto_hash.h"
+# include "psa_crypto_hash.h"
-#include "test/drivers/hash.h"
+# include "test/drivers/hash.h"
-mbedtls_test_driver_hash_hooks_t
- mbedtls_test_driver_hash_hooks = MBEDTLS_TEST_DRIVER_HASH_INIT;
+mbedtls_test_driver_hash_hooks_t mbedtls_test_driver_hash_hooks =
+ MBEDTLS_TEST_DRIVER_HASH_INIT;
-psa_status_t mbedtls_test_transparent_hash_compute(
- psa_algorithm_t alg,
- const uint8_t *input, size_t input_length,
- uint8_t *hash, size_t hash_size, size_t *hash_length )
+psa_status_t mbedtls_test_transparent_hash_compute(psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *hash,
+ size_t hash_size,
+ size_t *hash_length)
{
mbedtls_test_driver_hash_hooks.hits++;
- if( mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_test_driver_hash_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_hash_hooks.driver_status =
+ mbedtls_test_driver_hash_hooks.forced_status;
+ } else {
mbedtls_test_driver_hash_hooks.driver_status =
mbedtls_transparent_test_driver_hash_compute(
- alg, input, input_length,
- hash, hash_size, hash_length );
+ alg, input, input_length, hash, hash_size, hash_length);
}
- return mbedtls_test_driver_hash_hooks.driver_status ;
+ return mbedtls_test_driver_hash_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_hash_setup(
mbedtls_transparent_test_driver_hash_operation_t *operation,
- psa_algorithm_t alg )
+ psa_algorithm_t alg)
{
mbedtls_test_driver_hash_hooks.hits++;
- if( mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_test_driver_hash_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_transparent_test_driver_hash_setup( operation, alg );
+ mbedtls_test_driver_hash_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_hash_hooks.driver_status =
+ mbedtls_transparent_test_driver_hash_setup(operation, alg);
}
- return mbedtls_test_driver_hash_hooks.driver_status ;
+ return mbedtls_test_driver_hash_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_hash_clone(
const mbedtls_transparent_test_driver_hash_operation_t *source_operation,
- mbedtls_transparent_test_driver_hash_operation_t *target_operation )
+ mbedtls_transparent_test_driver_hash_operation_t *target_operation)
{
mbedtls_test_driver_hash_hooks.hits++;
- if( mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_test_driver_hash_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_transparent_test_driver_hash_clone( source_operation,
- target_operation );
+ mbedtls_test_driver_hash_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_hash_hooks.driver_status =
+ mbedtls_transparent_test_driver_hash_clone(source_operation,
+ target_operation);
}
- return mbedtls_test_driver_hash_hooks.driver_status ;
+ return mbedtls_test_driver_hash_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_hash_update(
mbedtls_transparent_test_driver_hash_operation_t *operation,
const uint8_t *input,
- size_t input_length )
+ size_t input_length)
{
mbedtls_test_driver_hash_hooks.hits++;
- if( mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_test_driver_hash_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_transparent_test_driver_hash_update(
- operation, input, input_length );
+ mbedtls_test_driver_hash_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_hash_hooks.driver_status =
+ mbedtls_transparent_test_driver_hash_update(operation, input,
+ input_length);
}
- return mbedtls_test_driver_hash_hooks.driver_status ;
+ return mbedtls_test_driver_hash_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_hash_finish(
mbedtls_transparent_test_driver_hash_operation_t *operation,
uint8_t *hash,
size_t hash_size,
- size_t *hash_length )
+ size_t *hash_length)
{
mbedtls_test_driver_hash_hooks.hits++;
- if( mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_test_driver_hash_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_transparent_test_driver_hash_finish(
- operation, hash, hash_size, hash_length );
+ mbedtls_test_driver_hash_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_hash_hooks.driver_status =
+ mbedtls_transparent_test_driver_hash_finish(operation, hash,
+ hash_size, hash_length);
}
- return mbedtls_test_driver_hash_hooks.driver_status ;
+ return mbedtls_test_driver_hash_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_hash_abort(
- mbedtls_transparent_test_driver_hash_operation_t *operation )
+ mbedtls_transparent_test_driver_hash_operation_t *operation)
{
mbedtls_test_driver_hash_hooks.hits++;
- if( mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_test_driver_hash_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_hash_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_hash_hooks.driver_status =
- mbedtls_transparent_test_driver_hash_abort( operation );
+ mbedtls_test_driver_hash_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_hash_hooks.driver_status =
+ mbedtls_transparent_test_driver_hash_abort(operation);
}
- return mbedtls_test_driver_hash_hooks.driver_status ;
+ return mbedtls_test_driver_hash_hooks.driver_status;
}
#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */
diff --git a/tests/src/drivers/platform_builtin_keys.c b/tests/src/drivers/platform_builtin_keys.c
index 6d125a0..072f465 100644
--- a/tests/src/drivers/platform_builtin_keys.c
+++ b/tests/src/drivers/platform_builtin_keys.c
@@ -26,11 +26,10 @@
#include <psa/crypto_extra.h>
#if defined(PSA_CRYPTO_DRIVER_TEST)
-#include <test/drivers/test_driver.h>
+# include <test/drivers/test_driver.h>
#endif
-typedef struct
-{
+typedef struct {
psa_key_id_t builtin_key_id;
psa_key_lifetime_t lifetime;
psa_drv_slot_number_t slot_number;
@@ -42,52 +41,56 @@
* ECDSA can be exercised on key ID MBEDTLS_PSA_KEY_ID_BUILTIN_MIN + 1. */
{ MBEDTLS_PSA_KEY_ID_BUILTIN_MIN - 1,
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
- PSA_KEY_PERSISTENCE_READ_ONLY, PSA_CRYPTO_TEST_DRIVER_LOCATION ),
+ PSA_KEY_PERSISTENCE_READ_ONLY,
+ PSA_CRYPTO_TEST_DRIVER_LOCATION),
PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT },
{ MBEDTLS_PSA_KEY_ID_BUILTIN_MIN,
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
- PSA_KEY_PERSISTENCE_READ_ONLY, PSA_CRYPTO_TEST_DRIVER_LOCATION ),
+ PSA_KEY_PERSISTENCE_READ_ONLY,
+ PSA_CRYPTO_TEST_DRIVER_LOCATION),
PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT },
{ MBEDTLS_PSA_KEY_ID_BUILTIN_MIN + 1,
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
- PSA_KEY_PERSISTENCE_READ_ONLY, PSA_CRYPTO_TEST_DRIVER_LOCATION ),
- PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT},
+ PSA_KEY_PERSISTENCE_READ_ONLY,
+ PSA_CRYPTO_TEST_DRIVER_LOCATION),
+ PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT },
{ MBEDTLS_PSA_KEY_ID_BUILTIN_MAX - 1,
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
- PSA_KEY_PERSISTENCE_READ_ONLY, PSA_CRYPTO_TEST_DRIVER_LOCATION ),
- PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT},
+ PSA_KEY_PERSISTENCE_READ_ONLY,
+ PSA_CRYPTO_TEST_DRIVER_LOCATION),
+ PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT },
{ MBEDTLS_PSA_KEY_ID_BUILTIN_MAX,
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
- PSA_KEY_PERSISTENCE_READ_ONLY, PSA_CRYPTO_TEST_DRIVER_LOCATION ),
- PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT},
+ PSA_KEY_PERSISTENCE_READ_ONLY,
+ PSA_CRYPTO_TEST_DRIVER_LOCATION),
+ PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT },
{ MBEDTLS_PSA_KEY_ID_BUILTIN_MAX + 1,
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
- PSA_KEY_PERSISTENCE_READ_ONLY, PSA_CRYPTO_TEST_DRIVER_LOCATION ),
- PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT},
+ PSA_KEY_PERSISTENCE_READ_ONLY,
+ PSA_CRYPTO_TEST_DRIVER_LOCATION),
+ PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT },
#else
- {0, 0, 0}
+ { 0, 0, 0 }
#endif
};
-psa_status_t mbedtls_psa_platform_get_builtin_key(
- mbedtls_svc_key_id_t key_id,
- psa_key_lifetime_t *lifetime,
- psa_drv_slot_number_t *slot_number )
+psa_status_t
+mbedtls_psa_platform_get_builtin_key(mbedtls_svc_key_id_t key_id,
+ psa_key_lifetime_t *lifetime,
+ psa_drv_slot_number_t *slot_number)
{
- psa_key_id_t app_key_id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID( key_id );
+ psa_key_id_t app_key_id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key_id);
const mbedtls_psa_builtin_key_description_t *builtin_key;
- for( size_t i = 0;
- i < ( sizeof( builtin_keys ) / sizeof( builtin_keys[0] ) ); i++ )
- {
+ for (size_t i = 0; i < (sizeof(builtin_keys) / sizeof(builtin_keys[0]));
+ i++) {
builtin_key = &builtin_keys[i];
- if( builtin_key->builtin_key_id == app_key_id )
- {
+ if (builtin_key->builtin_key_id == app_key_id) {
*lifetime = builtin_key->lifetime;
*slot_number = builtin_key->slot_number;
- return PSA_SUCCESS ;
+ return PSA_SUCCESS;
}
}
- return PSA_ERROR_DOES_NOT_EXIST ;
+ return PSA_ERROR_DOES_NOT_EXIST;
}
diff --git a/tests/src/drivers/test_driver_aead.c b/tests/src/drivers/test_driver_aead.c
index 76afcd7..4cc7751 100644
--- a/tests/src/drivers/test_driver_aead.c
+++ b/tests/src/drivers/test_driver_aead.c
@@ -20,73 +20,71 @@
#include <test/helpers.h>
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "psa_crypto_aead.h"
+# include "psa_crypto_aead.h"
-#include "test/drivers/aead.h"
+# include "test/drivers/aead.h"
-mbedtls_test_driver_aead_hooks_t
- mbedtls_test_driver_aead_hooks = MBEDTLS_TEST_DRIVER_AEAD_INIT;
+mbedtls_test_driver_aead_hooks_t mbedtls_test_driver_aead_hooks =
+ MBEDTLS_TEST_DRIVER_AEAD_INIT;
-psa_status_t mbedtls_test_transparent_aead_encrypt(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer, size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *nonce, size_t nonce_length,
- const uint8_t *additional_data, size_t additional_data_length,
- const uint8_t *plaintext, size_t plaintext_length,
- uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length )
+psa_status_t
+mbedtls_test_transparent_aead_encrypt(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *nonce,
+ size_t nonce_length,
+ const uint8_t *additional_data,
+ size_t additional_data_length,
+ const uint8_t *plaintext,
+ size_t plaintext_length,
+ uint8_t *ciphertext,
+ size_t ciphertext_size,
+ size_t *ciphertext_length)
{
mbedtls_test_driver_aead_hooks.hits++;
- if( mbedtls_test_driver_aead_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_aead_hooks.driver_status =
- mbedtls_test_driver_aead_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_aead_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_aead_hooks.driver_status =
- mbedtls_psa_aead_encrypt(
- attributes, key_buffer, key_buffer_size,
- alg,
- nonce, nonce_length,
- additional_data, additional_data_length,
- plaintext, plaintext_length,
- ciphertext, ciphertext_size, ciphertext_length );
+ mbedtls_test_driver_aead_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_aead_hooks.driver_status = mbedtls_psa_aead_encrypt(
+ attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length,
+ additional_data, additional_data_length, plaintext,
+ plaintext_length, ciphertext, ciphertext_size, ciphertext_length);
}
- return mbedtls_test_driver_aead_hooks.driver_status ;
+ return mbedtls_test_driver_aead_hooks.driver_status;
}
-psa_status_t mbedtls_test_transparent_aead_decrypt(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer, size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *nonce, size_t nonce_length,
- const uint8_t *additional_data, size_t additional_data_length,
- const uint8_t *ciphertext, size_t ciphertext_length,
- uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length )
+psa_status_t
+mbedtls_test_transparent_aead_decrypt(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *nonce,
+ size_t nonce_length,
+ const uint8_t *additional_data,
+ size_t additional_data_length,
+ const uint8_t *ciphertext,
+ size_t ciphertext_length,
+ uint8_t *plaintext,
+ size_t plaintext_size,
+ size_t *plaintext_length)
{
mbedtls_test_driver_aead_hooks.hits++;
- if( mbedtls_test_driver_aead_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_aead_hooks.driver_status =
- mbedtls_test_driver_aead_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_aead_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_aead_hooks.driver_status =
- mbedtls_psa_aead_decrypt(
- attributes, key_buffer, key_buffer_size,
- alg,
- nonce, nonce_length,
- additional_data, additional_data_length,
- ciphertext, ciphertext_length,
- plaintext, plaintext_size, plaintext_length );
+ mbedtls_test_driver_aead_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_aead_hooks.driver_status = mbedtls_psa_aead_decrypt(
+ attributes, key_buffer, key_buffer_size, alg, nonce, nonce_length,
+ additional_data, additional_data_length, ciphertext,
+ ciphertext_length, plaintext, plaintext_size, plaintext_length);
}
- return mbedtls_test_driver_aead_hooks.driver_status ;
+ return mbedtls_test_driver_aead_hooks.driver_status;
}
#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */
diff --git a/tests/src/drivers/test_driver_cipher.c b/tests/src/drivers/test_driver_cipher.c
index 20d79d8..0f369ba 100644
--- a/tests/src/drivers/test_driver_cipher.c
+++ b/tests/src/drivers/test_driver_cipher.c
@@ -21,96 +21,92 @@
#include <test/helpers.h>
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "psa/crypto.h"
-#include "psa_crypto_cipher.h"
-#include "psa_crypto_core.h"
-#include "mbedtls/cipher.h"
+# include "psa/crypto.h"
+# include "psa_crypto_cipher.h"
+# include "psa_crypto_core.h"
+# include "mbedtls/cipher.h"
-#include "test/drivers/cipher.h"
+# include "test/drivers/cipher.h"
-#include "test/random.h"
+# include "test/random.h"
-#include <string.h>
+# include <string.h>
mbedtls_test_driver_cipher_hooks_t mbedtls_test_driver_cipher_hooks =
MBEDTLS_TEST_DRIVER_CIPHER_INIT;
-psa_status_t mbedtls_test_transparent_cipher_encrypt(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer,
- size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *input,
- size_t input_length,
- uint8_t *output,
- size_t output_size,
- size_t *output_length )
+psa_status_t
+mbedtls_test_transparent_cipher_encrypt(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *output,
+ size_t output_size,
+ size_t *output_length)
{
mbedtls_test_driver_cipher_hooks.hits++;
- if( mbedtls_test_driver_cipher_hooks.forced_output != NULL )
- {
- if( output_size < mbedtls_test_driver_cipher_hooks.forced_output_length )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (mbedtls_test_driver_cipher_hooks.forced_output != NULL) {
+ if (output_size < mbedtls_test_driver_cipher_hooks.forced_output_length)
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( output,
- mbedtls_test_driver_cipher_hooks.forced_output,
- mbedtls_test_driver_cipher_hooks.forced_output_length );
+ memcpy(output, mbedtls_test_driver_cipher_hooks.forced_output,
+ mbedtls_test_driver_cipher_hooks.forced_output_length);
*output_length = mbedtls_test_driver_cipher_hooks.forced_output_length;
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ return mbedtls_test_driver_cipher_hooks.forced_status;
}
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- psa_generate_random( output, PSA_CIPHER_IV_LENGTH( attributes->core.type, alg ) );
+ psa_generate_random(output,
+ PSA_CIPHER_IV_LENGTH(attributes->core.type, alg));
- return( mbedtls_transparent_test_driver_cipher_encrypt(
- attributes, key_buffer, key_buffer_size,
- alg, input, input_length,
- output, output_size, output_length ) );
+ return (mbedtls_transparent_test_driver_cipher_encrypt(
+ attributes, key_buffer, key_buffer_size, alg, input, input_length,
+ output, output_size, output_length));
}
-psa_status_t mbedtls_test_transparent_cipher_decrypt(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer,
- size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *input,
- size_t input_length,
- uint8_t *output,
- size_t output_size,
- size_t *output_length )
+psa_status_t
+mbedtls_test_transparent_cipher_decrypt(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *output,
+ size_t output_size,
+ size_t *output_length)
{
- mbedtls_test_driver_cipher_hooks.hits++;
+ mbedtls_test_driver_cipher_hooks.hits++;
- if( mbedtls_test_driver_cipher_hooks.forced_output != NULL )
- {
- if( output_size < mbedtls_test_driver_cipher_hooks.forced_output_length )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (mbedtls_test_driver_cipher_hooks.forced_output != NULL) {
+ if (output_size < mbedtls_test_driver_cipher_hooks.forced_output_length)
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( output,
- mbedtls_test_driver_cipher_hooks.forced_output,
- mbedtls_test_driver_cipher_hooks.forced_output_length );
+ memcpy(output, mbedtls_test_driver_cipher_hooks.forced_output,
+ mbedtls_test_driver_cipher_hooks.forced_output_length);
*output_length = mbedtls_test_driver_cipher_hooks.forced_output_length;
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ return mbedtls_test_driver_cipher_hooks.forced_status;
}
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- return( mbedtls_transparent_test_driver_cipher_decrypt(
- attributes, key_buffer, key_buffer_size,
- alg, input, input_length,
- output, output_size, output_length ) );
+ return (mbedtls_transparent_test_driver_cipher_decrypt(
+ attributes, key_buffer, key_buffer_size, alg, input, input_length,
+ output, output_size, output_length));
}
psa_status_t mbedtls_test_transparent_cipher_encrypt_setup(
mbedtls_transparent_test_driver_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
+ const uint8_t *key,
+ size_t key_length,
psa_algorithm_t alg)
{
mbedtls_test_driver_cipher_hooks.hits++;
@@ -119,28 +115,29 @@
* useful for the test suite, since it gives a chance of catching memory
* corruption errors should the core not have allocated (enough) memory for
* our context struct. */
- memset( operation, 0, sizeof( *operation ) );
+ memset(operation, 0, sizeof(*operation));
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- return ( mbedtls_transparent_test_driver_cipher_encrypt_setup(
- operation, attributes, key, key_length, alg ) );
+ return (mbedtls_transparent_test_driver_cipher_encrypt_setup(
+ operation, attributes, key, key_length, alg));
}
psa_status_t mbedtls_test_transparent_cipher_decrypt_setup(
mbedtls_transparent_test_driver_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
+ const uint8_t *key,
+ size_t key_length,
psa_algorithm_t alg)
{
mbedtls_test_driver_cipher_hooks.hits++;
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- return ( mbedtls_transparent_test_driver_cipher_decrypt_setup(
- operation, attributes, key, key_length, alg ) );
+ return (mbedtls_transparent_test_driver_cipher_decrypt_setup(
+ operation, attributes, key, key_length, alg));
}
psa_status_t mbedtls_test_transparent_cipher_abort(
@@ -148,18 +145,18 @@
{
mbedtls_test_driver_cipher_hooks.hits++;
- if( operation->alg == 0 )
- return PSA_SUCCESS ;
+ if (operation->alg == 0)
+ return PSA_SUCCESS;
- mbedtls_transparent_test_driver_cipher_abort( operation );
+ mbedtls_transparent_test_driver_cipher_abort(operation);
/* Wiping the entire struct here, instead of member-by-member. This is
* useful for the test suite, since it gives a chance of catching memory
* corruption errors should the core not have allocated (enough) memory for
* our context struct. */
- memset( operation, 0, sizeof( *operation ) );
+ memset(operation, 0, sizeof(*operation));
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ return mbedtls_test_driver_cipher_hooks.forced_status;
}
psa_status_t mbedtls_test_transparent_cipher_set_iv(
@@ -169,11 +166,11 @@
{
mbedtls_test_driver_cipher_hooks.hits++;
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- return( mbedtls_transparent_test_driver_cipher_set_iv(
- operation, iv, iv_length ) );
+ return (mbedtls_transparent_test_driver_cipher_set_iv(operation, iv,
+ iv_length));
}
psa_status_t mbedtls_test_transparent_cipher_update(
@@ -186,25 +183,22 @@
{
mbedtls_test_driver_cipher_hooks.hits++;
- if( mbedtls_test_driver_cipher_hooks.forced_output != NULL )
- {
- if( output_size < mbedtls_test_driver_cipher_hooks.forced_output_length )
+ if (mbedtls_test_driver_cipher_hooks.forced_output != NULL) {
+ if (output_size < mbedtls_test_driver_cipher_hooks.forced_output_length)
return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( output,
- mbedtls_test_driver_cipher_hooks.forced_output,
- mbedtls_test_driver_cipher_hooks.forced_output_length );
+ memcpy(output, mbedtls_test_driver_cipher_hooks.forced_output,
+ mbedtls_test_driver_cipher_hooks.forced_output_length);
*output_length = mbedtls_test_driver_cipher_hooks.forced_output_length;
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ return mbedtls_test_driver_cipher_hooks.forced_status;
}
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- return( mbedtls_transparent_test_driver_cipher_update(
- operation, input, input_length,
- output, output_size, output_length ) );
+ return (mbedtls_transparent_test_driver_cipher_update(
+ operation, input, input_length, output, output_size, output_length));
}
psa_status_t mbedtls_test_transparent_cipher_finish(
@@ -215,100 +209,108 @@
{
mbedtls_test_driver_cipher_hooks.hits++;
- if( mbedtls_test_driver_cipher_hooks.forced_output != NULL )
- {
- if( output_size < mbedtls_test_driver_cipher_hooks.forced_output_length )
+ if (mbedtls_test_driver_cipher_hooks.forced_output != NULL) {
+ if (output_size < mbedtls_test_driver_cipher_hooks.forced_output_length)
return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( output,
- mbedtls_test_driver_cipher_hooks.forced_output,
- mbedtls_test_driver_cipher_hooks.forced_output_length );
+ memcpy(output, mbedtls_test_driver_cipher_hooks.forced_output,
+ mbedtls_test_driver_cipher_hooks.forced_output_length);
*output_length = mbedtls_test_driver_cipher_hooks.forced_output_length;
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ return mbedtls_test_driver_cipher_hooks.forced_status;
}
- if( mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_cipher_hooks.forced_status ;
+ if (mbedtls_test_driver_cipher_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_cipher_hooks.forced_status;
- return( mbedtls_transparent_test_driver_cipher_finish(
- operation, output, output_size, output_length ) );
+ return (mbedtls_transparent_test_driver_cipher_finish(
+ operation, output, output_size, output_length));
}
/*
* opaque versions, to do
*/
-psa_status_t mbedtls_test_opaque_cipher_encrypt(
- const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
- psa_algorithm_t alg,
- const uint8_t *input, size_t input_length,
- uint8_t *output, size_t output_size, size_t *output_length)
+psa_status_t
+mbedtls_test_opaque_cipher_encrypt(const psa_key_attributes_t *attributes,
+ const uint8_t *key,
+ size_t key_length,
+ psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *output,
+ size_t output_size,
+ size_t *output_length)
{
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- (void) input;
- (void) input_length;
- (void) output;
- (void) output_size;
- (void) output_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ (void)input;
+ (void)input_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
-psa_status_t mbedtls_test_opaque_cipher_decrypt(
- const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
- psa_algorithm_t alg,
- const uint8_t *input, size_t input_length,
- uint8_t *output, size_t output_size, size_t *output_length)
+psa_status_t
+mbedtls_test_opaque_cipher_decrypt(const psa_key_attributes_t *attributes,
+ const uint8_t *key,
+ size_t key_length,
+ psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *output,
+ size_t output_size,
+ size_t *output_length)
{
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- (void) input;
- (void) input_length;
- (void) output;
- (void) output_size;
- (void) output_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ (void)input;
+ (void)input_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_opaque_cipher_encrypt_setup(
mbedtls_opaque_test_driver_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
+ const uint8_t *key,
+ size_t key_length,
psa_algorithm_t alg)
{
- (void) operation;
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)operation;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_opaque_cipher_decrypt_setup(
mbedtls_opaque_test_driver_cipher_operation_t *operation,
const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
+ const uint8_t *key,
+ size_t key_length,
psa_algorithm_t alg)
{
- (void) operation;
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)operation;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_opaque_cipher_abort(
- mbedtls_opaque_test_driver_cipher_operation_t *operation )
+ mbedtls_opaque_test_driver_cipher_operation_t *operation)
{
- (void) operation;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)operation;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_opaque_cipher_set_iv(
@@ -316,10 +318,10 @@
const uint8_t *iv,
size_t iv_length)
{
- (void) operation;
- (void) iv;
- (void) iv_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)operation;
+ (void)iv;
+ (void)iv_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_opaque_cipher_update(
@@ -330,13 +332,13 @@
size_t output_size,
size_t *output_length)
{
- (void) operation;
- (void) input;
- (void) input_length;
- (void) output;
- (void) output_size;
- (void) output_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)operation;
+ (void)input;
+ (void)input_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_opaque_cipher_finish(
@@ -345,10 +347,10 @@
size_t output_size,
size_t *output_length)
{
- (void) operation;
- (void) output;
- (void) output_size;
- (void) output_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)operation;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */
diff --git a/tests/src/drivers/test_driver_key_management.c b/tests/src/drivers/test_driver_key_management.c
index d2bc9b8..dd1b206 100644
--- a/tests/src/drivers/test_driver_key_management.c
+++ b/tests/src/drivers/test_driver_key_management.c
@@ -21,136 +21,130 @@
#include <test/helpers.h>
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "psa/crypto.h"
-#include "psa_crypto_core.h"
-#include "psa_crypto_ecp.h"
-#include "psa_crypto_rsa.h"
-#include "mbedtls/ecp.h"
-#include "mbedtls/error.h"
+# include "psa/crypto.h"
+# include "psa_crypto_core.h"
+# include "psa_crypto_ecp.h"
+# include "psa_crypto_rsa.h"
+# include "mbedtls/ecp.h"
+# include "mbedtls/error.h"
-#include "test/drivers/key_management.h"
+# include "test/drivers/key_management.h"
-#include "test/random.h"
+# include "test/random.h"
-#include <string.h>
+# include <string.h>
mbedtls_test_driver_key_management_hooks_t
- mbedtls_test_driver_key_management_hooks = MBEDTLS_TEST_DRIVER_KEY_MANAGEMENT_INIT;
+ mbedtls_test_driver_key_management_hooks =
+ MBEDTLS_TEST_DRIVER_KEY_MANAGEMENT_INIT;
-const uint8_t mbedtls_test_driver_aes_key[16] =
- { 0x36, 0x77, 0x39, 0x7A, 0x24, 0x43, 0x26, 0x46,
- 0x29, 0x4A, 0x40, 0x4E, 0x63, 0x52, 0x66, 0x55 };
-const uint8_t mbedtls_test_driver_ecdsa_key[32] =
- { 0xdc, 0x7d, 0x9d, 0x26, 0xd6, 0x7a, 0x4f, 0x63,
- 0x2c, 0x34, 0xc2, 0xdc, 0x0b, 0x69, 0x86, 0x18,
- 0x38, 0x82, 0xc2, 0x06, 0xdf, 0x04, 0xcd, 0xb7,
- 0xd6, 0x9a, 0xab, 0xe2, 0x8b, 0xe4, 0xf8, 0x1a };
-const uint8_t mbedtls_test_driver_ecdsa_pubkey[65] =
- { 0x04,
- 0x85, 0xf6, 0x4d, 0x89, 0xf0, 0x0b, 0xe6, 0x6c,
- 0x88, 0xdd, 0x93, 0x7e, 0xfd, 0x6d, 0x7c, 0x44,
- 0x56, 0x48, 0xdc, 0xb7, 0x01, 0x15, 0x0b, 0x8a,
- 0x95, 0x09, 0x29, 0x58, 0x50, 0xf4, 0x1c, 0x19,
- 0x31, 0xe5, 0x71, 0xfb, 0x8f, 0x8c, 0x78, 0x31,
- 0x7a, 0x20, 0xb3, 0x80, 0xe8, 0x66, 0x58, 0x4b,
- 0xbc, 0x25, 0x16, 0xc3, 0xd2, 0x70, 0x2d, 0x79,
- 0x2f, 0x13, 0x1a, 0x92, 0x20, 0x95, 0xfd, 0x6c };
+const uint8_t mbedtls_test_driver_aes_key[16] = { 0x36, 0x77, 0x39, 0x7A,
+ 0x24, 0x43, 0x26, 0x46,
+ 0x29, 0x4A, 0x40, 0x4E,
+ 0x63, 0x52, 0x66, 0x55 };
+const uint8_t mbedtls_test_driver_ecdsa_key[32] = {
+ 0xdc, 0x7d, 0x9d, 0x26, 0xd6, 0x7a, 0x4f, 0x63, 0x2c, 0x34, 0xc2,
+ 0xdc, 0x0b, 0x69, 0x86, 0x18, 0x38, 0x82, 0xc2, 0x06, 0xdf, 0x04,
+ 0xcd, 0xb7, 0xd6, 0x9a, 0xab, 0xe2, 0x8b, 0xe4, 0xf8, 0x1a
+};
+const uint8_t mbedtls_test_driver_ecdsa_pubkey[65] = {
+ 0x04, 0x85, 0xf6, 0x4d, 0x89, 0xf0, 0x0b, 0xe6, 0x6c, 0x88, 0xdd,
+ 0x93, 0x7e, 0xfd, 0x6d, 0x7c, 0x44, 0x56, 0x48, 0xdc, 0xb7, 0x01,
+ 0x15, 0x0b, 0x8a, 0x95, 0x09, 0x29, 0x58, 0x50, 0xf4, 0x1c, 0x19,
+ 0x31, 0xe5, 0x71, 0xfb, 0x8f, 0x8c, 0x78, 0x31, 0x7a, 0x20, 0xb3,
+ 0x80, 0xe8, 0x66, 0x58, 0x4b, 0xbc, 0x25, 0x16, 0xc3, 0xd2, 0x70,
+ 0x2d, 0x79, 0x2f, 0x13, 0x1a, 0x92, 0x20, 0x95, 0xfd, 0x6c
+};
-psa_status_t mbedtls_test_transparent_generate_key(
- const psa_key_attributes_t *attributes,
- uint8_t *key, size_t key_size, size_t *key_length )
+psa_status_t
+mbedtls_test_transparent_generate_key(const psa_key_attributes_t *attributes,
+ uint8_t *key,
+ size_t key_size,
+ size_t *key_length)
{
++mbedtls_test_driver_key_management_hooks.hits;
- if( mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_key_management_hooks.forced_status ;
+ if (mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_key_management_hooks.forced_status;
- if( mbedtls_test_driver_key_management_hooks.forced_output != NULL )
- {
- if( mbedtls_test_driver_key_management_hooks.forced_output_length >
- key_size )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
- memcpy( key, mbedtls_test_driver_key_management_hooks.forced_output,
- mbedtls_test_driver_key_management_hooks.forced_output_length );
- *key_length = mbedtls_test_driver_key_management_hooks.forced_output_length;
- return PSA_SUCCESS ;
+ if (mbedtls_test_driver_key_management_hooks.forced_output != NULL) {
+ if (mbedtls_test_driver_key_management_hooks.forced_output_length >
+ key_size)
+ return PSA_ERROR_BUFFER_TOO_SMALL;
+ memcpy(key, mbedtls_test_driver_key_management_hooks.forced_output,
+ mbedtls_test_driver_key_management_hooks.forced_output_length);
+ *key_length =
+ mbedtls_test_driver_key_management_hooks.forced_output_length;
+ return PSA_SUCCESS;
}
/* Copied from psa_crypto.c */
-#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR)
- if ( PSA_KEY_TYPE_IS_ECC( psa_get_key_type( attributes ) )
- && PSA_KEY_TYPE_IS_KEY_PAIR( psa_get_key_type( attributes ) ) )
- {
- return( mbedtls_transparent_test_driver_ecp_generate_key(
- attributes, key, key_size, key_length ) );
- }
- else
-#endif /* defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) */
+# if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR)
+ if (PSA_KEY_TYPE_IS_ECC(psa_get_key_type(attributes)) &&
+ PSA_KEY_TYPE_IS_KEY_PAIR(psa_get_key_type(attributes))) {
+ return (mbedtls_transparent_test_driver_ecp_generate_key(
+ attributes, key, key_size, key_length));
+ } else
+# endif /* defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) */
-#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR)
- if ( psa_get_key_type( attributes ) == PSA_KEY_TYPE_RSA_KEY_PAIR )
- return( mbedtls_transparent_test_driver_rsa_generate_key(
- attributes, key, key_size, key_length ) );
+# if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR)
+ if (psa_get_key_type(attributes) == PSA_KEY_TYPE_RSA_KEY_PAIR)
+ return (mbedtls_transparent_test_driver_rsa_generate_key(
+ attributes, key, key_size, key_length));
else
-#endif /* defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) */
+# endif /* defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) */
{
(void)attributes;
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
}
-psa_status_t mbedtls_test_opaque_generate_key(
- const psa_key_attributes_t *attributes,
- uint8_t *key, size_t key_size, size_t *key_length )
+psa_status_t
+mbedtls_test_opaque_generate_key(const psa_key_attributes_t *attributes,
+ uint8_t *key,
+ size_t key_size,
+ size_t *key_length)
{
- (void) attributes;
- (void) key;
- (void) key_size;
- (void) key_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)attributes;
+ (void)key;
+ (void)key_size;
+ (void)key_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
-psa_status_t mbedtls_test_transparent_import_key(
- const psa_key_attributes_t *attributes,
- const uint8_t *data,
- size_t data_length,
- uint8_t *key_buffer,
- size_t key_buffer_size,
- size_t *key_buffer_length,
- size_t *bits)
+psa_status_t
+mbedtls_test_transparent_import_key(const psa_key_attributes_t *attributes,
+ const uint8_t *data,
+ size_t data_length,
+ uint8_t *key_buffer,
+ size_t key_buffer_size,
+ size_t *key_buffer_length,
+ size_t *bits)
{
++mbedtls_test_driver_key_management_hooks.hits;
- if( mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_key_management_hooks.forced_status ;
+ if (mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_key_management_hooks.forced_status;
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
- psa_key_type_t type = psa_get_key_type( attributes );
+ psa_key_type_t type = psa_get_key_type(attributes);
-#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \
- defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY)
- if( PSA_KEY_TYPE_IS_ECC( type ) )
- {
+# if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \
+ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY)
+ if (PSA_KEY_TYPE_IS_ECC(type)) {
status = mbedtls_transparent_test_driver_ecp_import_key(
- attributes,
- data, data_length,
- key_buffer, key_buffer_size,
- key_buffer_length, bits );
- }
- else
-#endif
-#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \
- defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY)
- if( PSA_KEY_TYPE_IS_RSA( type ) )
- {
+ attributes, data, data_length, key_buffer, key_buffer_size,
+ key_buffer_length, bits);
+ } else
+# endif
+# if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \
+ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY)
+ if (PSA_KEY_TYPE_IS_RSA(type)) {
status = mbedtls_transparent_test_driver_rsa_import_key(
- attributes,
- data, data_length,
- key_buffer, key_buffer_size,
- key_buffer_length, bits );
- }
- else
-#endif
+ attributes, data, data_length, key_buffer, key_buffer_size,
+ key_buffer_length, bits);
+ } else
+# endif
{
status = PSA_ERROR_NOT_SUPPORTED;
(void)data;
@@ -162,120 +156,118 @@
(void)type;
}
- return status ;
+ return status;
}
-psa_status_t mbedtls_test_opaque_export_key(
- const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
- uint8_t *data, size_t data_size, size_t *data_length )
+psa_status_t
+mbedtls_test_opaque_export_key(const psa_key_attributes_t *attributes,
+ const uint8_t *key,
+ size_t key_length,
+ uint8_t *data,
+ size_t data_size,
+ size_t *data_length)
{
- if( key_length != sizeof( psa_drv_slot_number_t ) )
- {
+ if (key_length != sizeof(psa_drv_slot_number_t)) {
/* Test driver does not support generic opaque key handling yet. */
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
/* Assume this is a builtin key based on the key material length. */
- psa_drv_slot_number_t slot_number = *( ( psa_drv_slot_number_t* ) key );
+ psa_drv_slot_number_t slot_number = *((psa_drv_slot_number_t *)key);
- switch( slot_number )
- {
+ switch (slot_number) {
case PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT:
/* This is the ECDSA slot. Verify the key's attributes before
* returning the private key. */
- if( psa_get_key_type( attributes ) !=
- PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_FAMILY_SECP_R1 ) )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( psa_get_key_bits( attributes ) != 256 )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( psa_get_key_algorithm( attributes ) !=
- PSA_ALG_ECDSA( PSA_ALG_ANY_HASH ) )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( ( psa_get_key_usage_flags( attributes ) &
- PSA_KEY_USAGE_EXPORT ) == 0 )
- return PSA_ERROR_CORRUPTION_DETECTED ;
+ if (psa_get_key_type(attributes) !=
+ PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1))
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if (psa_get_key_bits(attributes) != 256)
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if (psa_get_key_algorithm(attributes) !=
+ PSA_ALG_ECDSA(PSA_ALG_ANY_HASH))
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if ((psa_get_key_usage_flags(attributes) & PSA_KEY_USAGE_EXPORT) ==
+ 0)
+ return PSA_ERROR_CORRUPTION_DETECTED;
- if( data_size < sizeof( mbedtls_test_driver_ecdsa_key ) )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (data_size < sizeof(mbedtls_test_driver_ecdsa_key))
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( data, mbedtls_test_driver_ecdsa_key,
- sizeof( mbedtls_test_driver_ecdsa_key ) );
- *data_length = sizeof( mbedtls_test_driver_ecdsa_key );
- return PSA_SUCCESS ;
+ memcpy(data, mbedtls_test_driver_ecdsa_key,
+ sizeof(mbedtls_test_driver_ecdsa_key));
+ *data_length = sizeof(mbedtls_test_driver_ecdsa_key);
+ return PSA_SUCCESS;
case PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT:
/* This is the AES slot. Verify the key's attributes before
* returning the key. */
- if( psa_get_key_type( attributes ) != PSA_KEY_TYPE_AES )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( psa_get_key_bits( attributes ) != 128 )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( psa_get_key_algorithm( attributes ) != PSA_ALG_CTR )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( ( psa_get_key_usage_flags( attributes ) &
- PSA_KEY_USAGE_EXPORT ) == 0 )
- return PSA_ERROR_CORRUPTION_DETECTED ;
+ if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES)
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if (psa_get_key_bits(attributes) != 128)
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if (psa_get_key_algorithm(attributes) != PSA_ALG_CTR)
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if ((psa_get_key_usage_flags(attributes) & PSA_KEY_USAGE_EXPORT) ==
+ 0)
+ return PSA_ERROR_CORRUPTION_DETECTED;
- if( data_size < sizeof( mbedtls_test_driver_aes_key ) )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (data_size < sizeof(mbedtls_test_driver_aes_key))
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( data, mbedtls_test_driver_aes_key,
- sizeof( mbedtls_test_driver_aes_key ) );
- *data_length = sizeof( mbedtls_test_driver_aes_key );
- return PSA_SUCCESS ;
+ memcpy(data, mbedtls_test_driver_aes_key,
+ sizeof(mbedtls_test_driver_aes_key));
+ *data_length = sizeof(mbedtls_test_driver_aes_key);
+ return PSA_SUCCESS;
default:
- return PSA_ERROR_DOES_NOT_EXIST ;
+ return PSA_ERROR_DOES_NOT_EXIST;
}
}
psa_status_t mbedtls_test_transparent_export_public_key(
const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer, size_t key_buffer_size,
- uint8_t *data, size_t data_size, size_t *data_length )
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ uint8_t *data,
+ size_t data_size,
+ size_t *data_length)
{
++mbedtls_test_driver_key_management_hooks.hits;
- if( mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_key_management_hooks.forced_status ;
+ if (mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_key_management_hooks.forced_status;
- if( mbedtls_test_driver_key_management_hooks.forced_output != NULL )
- {
- if( mbedtls_test_driver_key_management_hooks.forced_output_length >
- data_size )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
- memcpy( data, mbedtls_test_driver_key_management_hooks.forced_output,
- mbedtls_test_driver_key_management_hooks.forced_output_length );
- *data_length = mbedtls_test_driver_key_management_hooks.forced_output_length;
- return PSA_SUCCESS ;
+ if (mbedtls_test_driver_key_management_hooks.forced_output != NULL) {
+ if (mbedtls_test_driver_key_management_hooks.forced_output_length >
+ data_size)
+ return PSA_ERROR_BUFFER_TOO_SMALL;
+ memcpy(data, mbedtls_test_driver_key_management_hooks.forced_output,
+ mbedtls_test_driver_key_management_hooks.forced_output_length);
+ *data_length =
+ mbedtls_test_driver_key_management_hooks.forced_output_length;
+ return PSA_SUCCESS;
}
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
- psa_key_type_t key_type = psa_get_key_type( attributes );
+ psa_key_type_t key_type = psa_get_key_type(attributes);
-#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \
- defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY)
- if( PSA_KEY_TYPE_IS_ECC( key_type ) )
- {
+# if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \
+ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY)
+ if (PSA_KEY_TYPE_IS_ECC(key_type)) {
status = mbedtls_transparent_test_driver_ecp_export_public_key(
- attributes,
- key_buffer, key_buffer_size,
- data, data_size, data_length );
- }
- else
-#endif
-#if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \
- defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY)
- if( PSA_KEY_TYPE_IS_RSA( key_type ) )
- {
+ attributes, key_buffer, key_buffer_size, data, data_size,
+ data_length);
+ } else
+# endif
+# if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \
+ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY)
+ if (PSA_KEY_TYPE_IS_RSA(key_type)) {
status = mbedtls_transparent_test_driver_rsa_export_public_key(
- attributes,
- key_buffer, key_buffer_size,
- data, data_size, data_length );
- }
- else
-#endif
+ attributes, key_buffer, key_buffer_size, data, data_size,
+ data_length);
+ } else
+# endif
{
status = PSA_ERROR_NOT_SUPPORTED;
(void)key_buffer;
@@ -283,46 +275,47 @@
(void)key_type;
}
- return status ;
+ return status;
}
-psa_status_t mbedtls_test_opaque_export_public_key(
- const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
- uint8_t *data, size_t data_size, size_t *data_length )
+psa_status_t
+mbedtls_test_opaque_export_public_key(const psa_key_attributes_t *attributes,
+ const uint8_t *key,
+ size_t key_length,
+ uint8_t *data,
+ size_t data_size,
+ size_t *data_length)
{
- if( key_length != sizeof( psa_drv_slot_number_t ) )
- {
+ if (key_length != sizeof(psa_drv_slot_number_t)) {
/* Test driver does not support generic opaque key handling yet. */
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
/* Assume this is a builtin key based on the key material length. */
- psa_drv_slot_number_t slot_number = *( ( psa_drv_slot_number_t* ) key );
- switch( slot_number )
- {
+ psa_drv_slot_number_t slot_number = *((psa_drv_slot_number_t *)key);
+ switch (slot_number) {
case PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT:
/* This is the ECDSA slot. Verify the key's attributes before
* returning the public key. */
- if( psa_get_key_type( attributes ) !=
- PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_FAMILY_SECP_R1 ) )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( psa_get_key_bits( attributes ) != 256 )
- return PSA_ERROR_CORRUPTION_DETECTED ;
- if( psa_get_key_algorithm( attributes ) !=
- PSA_ALG_ECDSA( PSA_ALG_ANY_HASH ) )
- return PSA_ERROR_CORRUPTION_DETECTED ;
+ if (psa_get_key_type(attributes) !=
+ PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1))
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if (psa_get_key_bits(attributes) != 256)
+ return PSA_ERROR_CORRUPTION_DETECTED;
+ if (psa_get_key_algorithm(attributes) !=
+ PSA_ALG_ECDSA(PSA_ALG_ANY_HASH))
+ return PSA_ERROR_CORRUPTION_DETECTED;
- if( data_size < sizeof( mbedtls_test_driver_ecdsa_pubkey ) )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (data_size < sizeof(mbedtls_test_driver_ecdsa_pubkey))
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( data, mbedtls_test_driver_ecdsa_pubkey,
- sizeof( mbedtls_test_driver_ecdsa_pubkey ) );
- *data_length = sizeof( mbedtls_test_driver_ecdsa_pubkey );
- return PSA_SUCCESS ;
+ memcpy(data, mbedtls_test_driver_ecdsa_pubkey,
+ sizeof(mbedtls_test_driver_ecdsa_pubkey));
+ *data_length = sizeof(mbedtls_test_driver_ecdsa_pubkey);
+ return PSA_SUCCESS;
default:
- return PSA_ERROR_DOES_NOT_EXIST ;
+ return PSA_ERROR_DOES_NOT_EXIST;
}
}
@@ -336,52 +329,47 @@
* (i.e. for an actual driver this would mean 'builtin_key_size' =
* sizeof(psa_drv_slot_number_t)).
*/
-psa_status_t mbedtls_test_opaque_get_builtin_key(
- psa_drv_slot_number_t slot_number,
- psa_key_attributes_t *attributes,
- uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length )
+psa_status_t
+mbedtls_test_opaque_get_builtin_key(psa_drv_slot_number_t slot_number,
+ psa_key_attributes_t *attributes,
+ uint8_t *key_buffer,
+ size_t key_buffer_size,
+ size_t *key_buffer_length)
{
- switch( slot_number )
- {
+ switch (slot_number) {
case PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT:
- psa_set_key_type( attributes, PSA_KEY_TYPE_AES );
- psa_set_key_bits( attributes, 128 );
- psa_set_key_usage_flags(
- attributes,
- PSA_KEY_USAGE_ENCRYPT |
- PSA_KEY_USAGE_DECRYPT |
- PSA_KEY_USAGE_EXPORT );
- psa_set_key_algorithm( attributes, PSA_ALG_CTR );
+ psa_set_key_type(attributes, PSA_KEY_TYPE_AES);
+ psa_set_key_bits(attributes, 128);
+ psa_set_key_usage_flags(attributes, PSA_KEY_USAGE_ENCRYPT |
+ PSA_KEY_USAGE_DECRYPT |
+ PSA_KEY_USAGE_EXPORT);
+ psa_set_key_algorithm(attributes, PSA_ALG_CTR);
- if( key_buffer_size < sizeof( psa_drv_slot_number_t ) )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (key_buffer_size < sizeof(psa_drv_slot_number_t))
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- *( (psa_drv_slot_number_t*) key_buffer ) =
+ *((psa_drv_slot_number_t *)key_buffer) =
PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT;
- *key_buffer_length = sizeof( psa_drv_slot_number_t );
- return PSA_SUCCESS ;
+ *key_buffer_length = sizeof(psa_drv_slot_number_t);
+ return PSA_SUCCESS;
case PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT:
- psa_set_key_type(
- attributes,
- PSA_KEY_TYPE_ECC_KEY_PAIR( PSA_ECC_FAMILY_SECP_R1 ) );
- psa_set_key_bits( attributes, 256 );
- psa_set_key_usage_flags(
- attributes,
- PSA_KEY_USAGE_SIGN_HASH |
- PSA_KEY_USAGE_VERIFY_HASH |
- PSA_KEY_USAGE_EXPORT );
- psa_set_key_algorithm(
- attributes, PSA_ALG_ECDSA( PSA_ALG_ANY_HASH ) );
+ psa_set_key_type(attributes,
+ PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1));
+ psa_set_key_bits(attributes, 256);
+ psa_set_key_usage_flags(attributes, PSA_KEY_USAGE_SIGN_HASH |
+ PSA_KEY_USAGE_VERIFY_HASH |
+ PSA_KEY_USAGE_EXPORT);
+ psa_set_key_algorithm(attributes, PSA_ALG_ECDSA(PSA_ALG_ANY_HASH));
- if( key_buffer_size < sizeof( psa_drv_slot_number_t ) )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (key_buffer_size < sizeof(psa_drv_slot_number_t))
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- *( (psa_drv_slot_number_t*) key_buffer ) =
+ *((psa_drv_slot_number_t *)key_buffer) =
PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT;
- *key_buffer_length = sizeof( psa_drv_slot_number_t );
- return PSA_SUCCESS ;
+ *key_buffer_length = sizeof(psa_drv_slot_number_t);
+ return PSA_SUCCESS;
default:
- return PSA_ERROR_DOES_NOT_EXIST ;
+ return PSA_ERROR_DOES_NOT_EXIST;
}
}
diff --git a/tests/src/drivers/test_driver_mac.c b/tests/src/drivers/test_driver_mac.c
index cfcf162..4a8504e 100644
--- a/tests/src/drivers/test_driver_mac.c
+++ b/tests/src/drivers/test_driver_mac.c
@@ -20,41 +20,37 @@
#include <test/helpers.h>
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "psa_crypto_mac.h"
+# include "psa_crypto_mac.h"
-#include "test/drivers/mac.h"
+# include "test/drivers/mac.h"
mbedtls_test_driver_mac_hooks_t mbedtls_test_driver_mac_hooks =
MBEDTLS_TEST_DRIVER_MAC_INIT;
-psa_status_t mbedtls_test_transparent_mac_compute(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer,
- size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *input,
- size_t input_length,
- uint8_t *mac,
- size_t mac_size,
- size_t *mac_length )
+psa_status_t
+mbedtls_test_transparent_mac_compute(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *mac,
+ size_t mac_size,
+ size_t *mac_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
mbedtls_test_driver_mac_hooks.driver_status =
mbedtls_transparent_test_driver_mac_compute(
- attributes, key_buffer, key_buffer_size, alg,
- input, input_length,
- mac, mac_size, mac_length );
+ attributes, key_buffer, key_buffer_size, alg, input,
+ input_length, mac, mac_size, mac_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_mac_sign_setup(
@@ -62,23 +58,20 @@
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer,
size_t key_buffer_size,
- psa_algorithm_t alg )
+ psa_algorithm_t alg)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
mbedtls_test_driver_mac_hooks.driver_status =
mbedtls_transparent_test_driver_mac_sign_setup(
- operation, attributes, key_buffer, key_buffer_size, alg );
+ operation, attributes, key_buffer, key_buffer_size, alg);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_mac_verify_setup(
@@ -86,139 +79,121 @@
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer,
size_t key_buffer_size,
- psa_algorithm_t alg )
+ psa_algorithm_t alg)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
mbedtls_test_driver_mac_hooks.driver_status =
mbedtls_transparent_test_driver_mac_verify_setup(
- operation, attributes, key_buffer, key_buffer_size, alg );
+ operation, attributes, key_buffer, key_buffer_size, alg);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_mac_update(
mbedtls_transparent_test_driver_mac_operation_t *operation,
const uint8_t *input,
- size_t input_length )
+ size_t input_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_transparent_test_driver_mac_update(
- operation, input, input_length );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_transparent_test_driver_mac_update(operation, input,
+ input_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_mac_sign_finish(
mbedtls_transparent_test_driver_mac_operation_t *operation,
uint8_t *mac,
size_t mac_size,
- size_t *mac_length )
+ size_t *mac_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
mbedtls_test_driver_mac_hooks.driver_status =
mbedtls_transparent_test_driver_mac_sign_finish(
- operation, mac, mac_size, mac_length );
+ operation, mac, mac_size, mac_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_mac_verify_finish(
mbedtls_transparent_test_driver_mac_operation_t *operation,
const uint8_t *mac,
- size_t mac_length )
+ size_t mac_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_transparent_test_driver_mac_verify_finish(
- operation, mac, mac_length );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_transparent_test_driver_mac_verify_finish(operation, mac,
+ mac_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_transparent_mac_abort(
- mbedtls_transparent_test_driver_mac_operation_t *operation )
+ mbedtls_transparent_test_driver_mac_operation_t *operation)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_transparent_test_driver_mac_abort( operation );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_transparent_test_driver_mac_abort(operation);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
-psa_status_t mbedtls_test_opaque_mac_compute(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer,
- size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *input,
- size_t input_length,
- uint8_t *mac,
- size_t mac_size,
- size_t *mac_length )
+psa_status_t
+mbedtls_test_opaque_mac_compute(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *input,
+ size_t input_length,
+ uint8_t *mac,
+ size_t mac_size,
+ size_t *mac_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_opaque_test_driver_mac_compute(
- attributes, key_buffer, key_buffer_size, alg,
- input, input_length,
- mac, mac_size, mac_length );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_opaque_test_driver_mac_compute(attributes, key_buffer,
+ key_buffer_size, alg, input,
+ input_length, mac, mac_size,
+ mac_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_opaque_mac_sign_setup(
@@ -226,23 +201,20 @@
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer,
size_t key_buffer_size,
- psa_algorithm_t alg )
+ psa_algorithm_t alg)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
mbedtls_test_driver_mac_hooks.driver_status =
mbedtls_opaque_test_driver_mac_sign_setup(
- operation, attributes, key_buffer, key_buffer_size, alg );
+ operation, attributes, key_buffer, key_buffer_size, alg);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_opaque_mac_verify_setup(
@@ -250,109 +222,94 @@
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer,
size_t key_buffer_size,
- psa_algorithm_t alg )
+ psa_algorithm_t alg)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
mbedtls_test_driver_mac_hooks.driver_status =
mbedtls_opaque_test_driver_mac_verify_setup(
- operation, attributes, key_buffer, key_buffer_size, alg );
+ operation, attributes, key_buffer, key_buffer_size, alg);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_opaque_mac_update(
mbedtls_opaque_test_driver_mac_operation_t *operation,
const uint8_t *input,
- size_t input_length )
+ size_t input_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_opaque_test_driver_mac_update(
- operation, input, input_length );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_opaque_test_driver_mac_update(operation, input,
+ input_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_opaque_mac_sign_finish(
mbedtls_opaque_test_driver_mac_operation_t *operation,
uint8_t *mac,
size_t mac_size,
- size_t *mac_length )
+ size_t *mac_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_opaque_test_driver_mac_sign_finish(
- operation, mac, mac_size, mac_length );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_opaque_test_driver_mac_sign_finish(operation, mac, mac_size,
+ mac_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_opaque_mac_verify_finish(
mbedtls_opaque_test_driver_mac_operation_t *operation,
const uint8_t *mac,
- size_t mac_length )
+ size_t mac_length)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_opaque_test_driver_mac_verify_finish(
- operation, mac, mac_length );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_opaque_test_driver_mac_verify_finish(operation, mac,
+ mac_length);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
psa_status_t mbedtls_test_opaque_mac_abort(
- mbedtls_opaque_test_driver_mac_operation_t *operation )
+ mbedtls_opaque_test_driver_mac_operation_t *operation)
{
mbedtls_test_driver_mac_hooks.hits++;
- if( mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS )
- {
- mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_test_driver_mac_hooks.forced_status;
- }
- else
- {
+ if (mbedtls_test_driver_mac_hooks.forced_status != PSA_SUCCESS) {
mbedtls_test_driver_mac_hooks.driver_status =
- mbedtls_opaque_test_driver_mac_abort( operation );
+ mbedtls_test_driver_mac_hooks.forced_status;
+ } else {
+ mbedtls_test_driver_mac_hooks.driver_status =
+ mbedtls_opaque_test_driver_mac_abort(operation);
}
- return mbedtls_test_driver_mac_hooks.driver_status ;
+ return mbedtls_test_driver_mac_hooks.driver_status;
}
#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */
diff --git a/tests/src/drivers/test_driver_signature.c b/tests/src/drivers/test_driver_signature.c
index e573b72..4bf60a5 100644
--- a/tests/src/drivers/test_driver_signature.c
+++ b/tests/src/drivers/test_driver_signature.c
@@ -22,78 +22,66 @@
#include <test/helpers.h>
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "psa/crypto.h"
-#include "psa_crypto_core.h"
-#include "psa_crypto_ecp.h"
-#include "psa_crypto_hash.h"
-#include "psa_crypto_rsa.h"
-#include "mbedtls/ecp.h"
+# include "psa/crypto.h"
+# include "psa_crypto_core.h"
+# include "psa_crypto_ecp.h"
+# include "psa_crypto_hash.h"
+# include "psa_crypto_rsa.h"
+# include "mbedtls/ecp.h"
-#include "test/drivers/signature.h"
+# include "test/drivers/signature.h"
-#include "mbedtls/md.h"
-#include "mbedtls/ecdsa.h"
+# include "mbedtls/md.h"
+# include "mbedtls/ecdsa.h"
-#include "test/random.h"
+# include "test/random.h"
-#include <string.h>
+# include <string.h>
-mbedtls_test_driver_signature_hooks_t
- mbedtls_test_driver_signature_sign_hooks = MBEDTLS_TEST_DRIVER_SIGNATURE_INIT;
-mbedtls_test_driver_signature_hooks_t
- mbedtls_test_driver_signature_verify_hooks = MBEDTLS_TEST_DRIVER_SIGNATURE_INIT;
+mbedtls_test_driver_signature_hooks_t mbedtls_test_driver_signature_sign_hooks =
+ MBEDTLS_TEST_DRIVER_SIGNATURE_INIT;
+mbedtls_test_driver_signature_hooks_t mbedtls_test_driver_signature_verify_hooks =
+ MBEDTLS_TEST_DRIVER_SIGNATURE_INIT;
-psa_status_t sign_hash(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer,
- size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *hash,
- size_t hash_length,
- uint8_t *signature,
- size_t signature_size,
- size_t *signature_length )
+psa_status_t sign_hash(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *hash,
+ size_t hash_length,
+ uint8_t *signature,
+ size_t signature_size,
+ size_t *signature_length)
{
-#if defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS)
- if( attributes->core.type == PSA_KEY_TYPE_RSA_KEY_PAIR )
- {
- return( mbedtls_transparent_test_driver_rsa_sign_hash(
- attributes,
- key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_size, signature_length ) );
- }
- else
-#endif /* defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) ||
- * defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) */
+# if defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
+ defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS)
+ if (attributes->core.type == PSA_KEY_TYPE_RSA_KEY_PAIR) {
+ return (mbedtls_transparent_test_driver_rsa_sign_hash(
+ attributes, key_buffer, key_buffer_size, alg, hash, hash_length,
+ signature, signature_size, signature_length));
+ } else
+# endif /* defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
+ * defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) */
-#if defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
- if( PSA_KEY_TYPE_IS_ECC( attributes->core.type ) )
- {
- if(
-#if defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
- PSA_ALG_IS_ECDSA( alg )
-#else
- PSA_ALG_IS_RANDOMIZED_ECDSA( alg )
-#endif
- )
- {
- return( mbedtls_transparent_test_driver_ecdsa_sign_hash(
- attributes,
- key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_size, signature_length ) );
+# if defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
+ defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
+ if (PSA_KEY_TYPE_IS_ECC(attributes->core.type)) {
+ if (
+# if defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
+ PSA_ALG_IS_ECDSA(alg)
+# else
+ PSA_ALG_IS_RANDOMIZED_ECDSA(alg)
+# endif
+ ) {
+ return (mbedtls_transparent_test_driver_ecdsa_sign_hash(
+ attributes, key_buffer, key_buffer_size, alg, hash, hash_length,
+ signature, signature_size, signature_length));
+ } else {
+ return PSA_ERROR_INVALID_ARGUMENT;
}
- else
- {
- return PSA_ERROR_INVALID_ARGUMENT ;
- }
- }
- else
-#endif /* defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) ||
- * defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) */
+ } else
+# endif /* defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
+ * defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) */
{
(void)attributes;
(void)key_buffer;
@@ -104,54 +92,42 @@
(void)signature;
(void)signature_size;
(void)signature_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
}
-psa_status_t verify_hash(
- const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer,
- size_t key_buffer_size,
- psa_algorithm_t alg,
- const uint8_t *hash,
- size_t hash_length,
- const uint8_t *signature,
- size_t signature_length )
+psa_status_t verify_hash(const psa_key_attributes_t *attributes,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
+ psa_algorithm_t alg,
+ const uint8_t *hash,
+ size_t hash_length,
+ const uint8_t *signature,
+ size_t signature_length)
{
-#if defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS)
- if( PSA_KEY_TYPE_IS_RSA( attributes->core.type ) )
- {
- return( mbedtls_transparent_test_driver_rsa_verify_hash(
- attributes,
- key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_length ) );
- }
- else
-#endif /* defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) ||
- * defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) */
+# if defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
+ defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS)
+ if (PSA_KEY_TYPE_IS_RSA(attributes->core.type)) {
+ return (mbedtls_transparent_test_driver_rsa_verify_hash(
+ attributes, key_buffer, key_buffer_size, alg, hash, hash_length,
+ signature, signature_length));
+ } else
+# endif /* defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
+ * defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) */
-#if defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
- if( PSA_KEY_TYPE_IS_ECC( attributes->core.type ) )
- {
- if( PSA_ALG_IS_ECDSA( alg ) )
- {
- return( mbedtls_transparent_test_driver_ecdsa_verify_hash(
- attributes,
- key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_length ) );
+# if defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
+ defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
+ if (PSA_KEY_TYPE_IS_ECC(attributes->core.type)) {
+ if (PSA_ALG_IS_ECDSA(alg)) {
+ return (mbedtls_transparent_test_driver_ecdsa_verify_hash(
+ attributes, key_buffer, key_buffer_size, alg, hash, hash_length,
+ signature, signature_length));
+ } else {
+ return PSA_ERROR_INVALID_ARGUMENT;
}
- else
- {
- return PSA_ERROR_INVALID_ARGUMENT ;
- }
- }
- else
-#endif /* defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) ||
- * defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) */
+ } else
+# endif /* defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
+ * defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) */
{
(void)attributes;
(void)key_buffer;
@@ -162,7 +138,7 @@
(void)signature;
(void)signature_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
}
@@ -175,7 +151,7 @@
size_t input_length,
uint8_t *signature,
size_t signature_size,
- size_t *signature_length )
+ size_t *signature_length)
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
size_t hash_length;
@@ -183,31 +159,32 @@
++mbedtls_test_driver_signature_sign_hooks.hits;
- if( mbedtls_test_driver_signature_sign_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_signature_sign_hooks.forced_status ;
+ if (mbedtls_test_driver_signature_sign_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_signature_sign_hooks.forced_status;
- if( mbedtls_test_driver_signature_sign_hooks.forced_output != NULL )
- {
- if( mbedtls_test_driver_signature_sign_hooks.forced_output_length > signature_size )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
+ if (mbedtls_test_driver_signature_sign_hooks.forced_output != NULL) {
+ if (mbedtls_test_driver_signature_sign_hooks.forced_output_length >
+ signature_size)
+ return PSA_ERROR_BUFFER_TOO_SMALL;
- memcpy( signature, mbedtls_test_driver_signature_sign_hooks.forced_output,
- mbedtls_test_driver_signature_sign_hooks.forced_output_length );
- *signature_length = mbedtls_test_driver_signature_sign_hooks.forced_output_length;
+ memcpy(signature,
+ mbedtls_test_driver_signature_sign_hooks.forced_output,
+ mbedtls_test_driver_signature_sign_hooks.forced_output_length);
+ *signature_length =
+ mbedtls_test_driver_signature_sign_hooks.forced_output_length;
- return PSA_SUCCESS ;
+ return PSA_SUCCESS;
}
status = mbedtls_transparent_test_driver_hash_compute(
- PSA_ALG_SIGN_GET_HASH( alg ), input, input_length,
- hash, sizeof( hash ), &hash_length );
+ PSA_ALG_SIGN_GET_HASH(alg), input, input_length, hash, sizeof(hash),
+ &hash_length);
- if( status != PSA_SUCCESS )
+ if (status != PSA_SUCCESS)
return status;
- return sign_hash( attributes, key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_size, signature_length );
+ return sign_hash(attributes, key_buffer, key_buffer_size, alg, hash,
+ hash_length, signature, signature_size, signature_length);
}
psa_status_t mbedtls_test_opaque_signature_sign_message(
@@ -219,19 +196,19 @@
size_t input_length,
uint8_t *signature,
size_t signature_size,
- size_t *signature_length )
+ size_t *signature_length)
{
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- (void) input;
- (void) input_length;
- (void) signature;
- (void) signature_size;
- (void) signature_length;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ (void)input;
+ (void)input_length;
+ (void)signature;
+ (void)signature_size;
+ (void)signature_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_transparent_signature_verify_message(
@@ -242,7 +219,7 @@
const uint8_t *input,
size_t input_length,
const uint8_t *signature,
- size_t signature_length )
+ size_t signature_length)
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
size_t hash_length;
@@ -250,19 +227,18 @@
++mbedtls_test_driver_signature_verify_hooks.hits;
- if( mbedtls_test_driver_signature_verify_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_signature_verify_hooks.forced_status ;
+ if (mbedtls_test_driver_signature_verify_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_signature_verify_hooks.forced_status;
status = mbedtls_transparent_test_driver_hash_compute(
- PSA_ALG_SIGN_GET_HASH( alg ), input, input_length,
- hash, sizeof( hash ), &hash_length );
+ PSA_ALG_SIGN_GET_HASH(alg), input, input_length, hash, sizeof(hash),
+ &hash_length);
- if( status != PSA_SUCCESS )
+ if (status != PSA_SUCCESS)
return status;
- return verify_hash( attributes, key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_length );
+ return verify_hash(attributes, key_buffer, key_buffer_size, alg, hash,
+ hash_length, signature, signature_length);
}
psa_status_t mbedtls_test_opaque_signature_verify_message(
@@ -273,100 +249,114 @@
const uint8_t *input,
size_t input_length,
const uint8_t *signature,
- size_t signature_length )
+ size_t signature_length)
{
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- (void) input;
- (void) input_length;
- (void) signature;
- (void) signature_length;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ (void)input;
+ (void)input_length;
+ (void)signature;
+ (void)signature_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_transparent_signature_sign_hash(
const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer, size_t key_buffer_size,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
psa_algorithm_t alg,
- const uint8_t *hash, size_t hash_length,
- uint8_t *signature, size_t signature_size, size_t *signature_length )
+ const uint8_t *hash,
+ size_t hash_length,
+ uint8_t *signature,
+ size_t signature_size,
+ size_t *signature_length)
{
++mbedtls_test_driver_signature_sign_hooks.hits;
- if( mbedtls_test_driver_signature_sign_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_signature_sign_hooks.forced_status ;
+ if (mbedtls_test_driver_signature_sign_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_signature_sign_hooks.forced_status;
- if( mbedtls_test_driver_signature_sign_hooks.forced_output != NULL )
- {
- if( mbedtls_test_driver_signature_sign_hooks.forced_output_length > signature_size )
- return PSA_ERROR_BUFFER_TOO_SMALL ;
- memcpy( signature, mbedtls_test_driver_signature_sign_hooks.forced_output,
- mbedtls_test_driver_signature_sign_hooks.forced_output_length );
- *signature_length = mbedtls_test_driver_signature_sign_hooks.forced_output_length;
- return PSA_SUCCESS ;
+ if (mbedtls_test_driver_signature_sign_hooks.forced_output != NULL) {
+ if (mbedtls_test_driver_signature_sign_hooks.forced_output_length >
+ signature_size)
+ return PSA_ERROR_BUFFER_TOO_SMALL;
+ memcpy(signature,
+ mbedtls_test_driver_signature_sign_hooks.forced_output,
+ mbedtls_test_driver_signature_sign_hooks.forced_output_length);
+ *signature_length =
+ mbedtls_test_driver_signature_sign_hooks.forced_output_length;
+ return PSA_SUCCESS;
}
- return sign_hash( attributes, key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_size, signature_length );
+ return sign_hash(attributes, key_buffer, key_buffer_size, alg, hash,
+ hash_length, signature, signature_size, signature_length);
}
-psa_status_t mbedtls_test_opaque_signature_sign_hash(
- const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
- psa_algorithm_t alg,
- const uint8_t *hash, size_t hash_length,
- uint8_t *signature, size_t signature_size, size_t *signature_length )
+psa_status_t
+mbedtls_test_opaque_signature_sign_hash(const psa_key_attributes_t *attributes,
+ const uint8_t *key,
+ size_t key_length,
+ psa_algorithm_t alg,
+ const uint8_t *hash,
+ size_t hash_length,
+ uint8_t *signature,
+ size_t signature_size,
+ size_t *signature_length)
{
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- (void) hash;
- (void) hash_length;
- (void) signature;
- (void) signature_size;
- (void) signature_length;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ (void)hash;
+ (void)hash_length;
+ (void)signature;
+ (void)signature_size;
+ (void)signature_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t mbedtls_test_transparent_signature_verify_hash(
const psa_key_attributes_t *attributes,
- const uint8_t *key_buffer, size_t key_buffer_size,
+ const uint8_t *key_buffer,
+ size_t key_buffer_size,
psa_algorithm_t alg,
- const uint8_t *hash, size_t hash_length,
- const uint8_t *signature, size_t signature_length )
+ const uint8_t *hash,
+ size_t hash_length,
+ const uint8_t *signature,
+ size_t signature_length)
{
++mbedtls_test_driver_signature_verify_hooks.hits;
- if( mbedtls_test_driver_signature_verify_hooks.forced_status != PSA_SUCCESS )
- return mbedtls_test_driver_signature_verify_hooks.forced_status ;
+ if (mbedtls_test_driver_signature_verify_hooks.forced_status != PSA_SUCCESS)
+ return mbedtls_test_driver_signature_verify_hooks.forced_status;
- return verify_hash( attributes, key_buffer, key_buffer_size,
- alg, hash, hash_length,
- signature, signature_length );
+ return verify_hash(attributes, key_buffer, key_buffer_size, alg, hash,
+ hash_length, signature, signature_length);
}
psa_status_t mbedtls_test_opaque_signature_verify_hash(
const psa_key_attributes_t *attributes,
- const uint8_t *key, size_t key_length,
+ const uint8_t *key,
+ size_t key_length,
psa_algorithm_t alg,
- const uint8_t *hash, size_t hash_length,
- const uint8_t *signature, size_t signature_length )
+ const uint8_t *hash,
+ size_t hash_length,
+ const uint8_t *signature,
+ size_t signature_length)
{
- (void) attributes;
- (void) key;
- (void) key_length;
- (void) alg;
- (void) hash;
- (void) hash_length;
- (void) signature;
- (void) signature_length;
- return PSA_ERROR_NOT_SUPPORTED ;
+ (void)attributes;
+ (void)key;
+ (void)key_length;
+ (void)alg;
+ (void)hash;
+ (void)hash_length;
+ (void)signature;
+ (void)signature_length;
+ return PSA_ERROR_NOT_SUPPORTED;
}
#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */
diff --git a/tests/src/drivers/test_driver_size.c b/tests/src/drivers/test_driver_size.c
index 837d82a..66d8667 100644
--- a/tests/src/drivers/test_driver_size.c
+++ b/tests/src/drivers/test_driver_size.c
@@ -22,8 +22,8 @@
#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
-#include "test/drivers/size.h"
-#include "psa/crypto.h"
+# include "test/drivers/size.h"
+# include "psa/crypto.h"
typedef struct {
unsigned int context;
@@ -33,7 +33,7 @@
* This macro returns the base size for the key context. It is the size of the
* driver specific information stored in each key context.
*/
-#define TEST_DRIVER_KEY_CONTEXT_BASE_SIZE sizeof( test_driver_key_context_t )
+# define TEST_DRIVER_KEY_CONTEXT_BASE_SIZE sizeof(test_driver_key_context_t)
/*
* Number of bytes included in every key context for a key pair.
@@ -42,56 +42,51 @@
* Based on this value, the size of the private key can be derived by
* subtracting the public key size below from this one.
*/
-#define TEST_DRIVER_KEY_CONTEXT_KEY_PAIR_SIZE 65
+# define TEST_DRIVER_KEY_CONTEXT_KEY_PAIR_SIZE 65
/*
* Number of bytes included in every key context for a public key.
*
* For ECC public keys, it needs 257 bits so 33 bytes.
*/
-#define TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE 33
+# define TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE 33
/*
* Every key context for a symmetric key includes this many times the key size.
*/
-#define TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR 0
+# define TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR 0
/*
- * If this is true for a key pair, the key context includes space for the public key.
- * If this is false, no additional space is added for the public key.
+ * If this is true for a key pair, the key context includes space for the public
+ * key. If this is false, no additional space is added for the public key.
*
* For this instance, store the public key with the private one.
*/
-#define TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY 1
+# define TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY 1
-size_t mbedtls_test_size_function(
- const psa_key_type_t key_type,
- const size_t key_bits )
+size_t mbedtls_test_size_function(const psa_key_type_t key_type,
+ const size_t key_bits)
{
size_t key_buffer_size = 0;
- if( PSA_KEY_TYPE_IS_KEY_PAIR( key_type ) )
- {
+ if (PSA_KEY_TYPE_IS_KEY_PAIR(key_type)) {
int public_key_overhead =
- ( ( TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY == 1 )
- ? PSA_EXPORT_KEY_OUTPUT_SIZE( key_type, key_bits ) : 0 );
+ ((TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY == 1) ?
+ PSA_EXPORT_KEY_OUTPUT_SIZE(key_type, key_bits) :
+ 0);
key_buffer_size = TEST_DRIVER_KEY_CONTEXT_BASE_SIZE +
TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE +
public_key_overhead;
- }
- else if( PSA_KEY_TYPE_IS_PUBLIC_KEY( key_type ) )
- {
+ } else if (PSA_KEY_TYPE_IS_PUBLIC_KEY(key_type)) {
key_buffer_size = TEST_DRIVER_KEY_CONTEXT_BASE_SIZE +
TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE;
- }
- else if ( !PSA_KEY_TYPE_IS_KEY_PAIR( key_type ) &&
- !PSA_KEY_TYPE_IS_PUBLIC_KEY ( key_type ) )
- {
- key_buffer_size = TEST_DRIVER_KEY_CONTEXT_BASE_SIZE +
- ( TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR *
- ( ( key_bits + 7 ) / 8 ) );
+ } else if (!PSA_KEY_TYPE_IS_KEY_PAIR(key_type) &&
+ !PSA_KEY_TYPE_IS_PUBLIC_KEY(key_type)) {
+ key_buffer_size =
+ TEST_DRIVER_KEY_CONTEXT_BASE_SIZE +
+ (TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR * ((key_bits + 7) / 8));
}
- return key_buffer_size ;
+ return key_buffer_size;
}
#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */
diff --git a/tests/src/fake_external_rng_for_test.c b/tests/src/fake_external_rng_for_test.c
index ec83541..bdcd3e3 100644
--- a/tests/src/fake_external_rng_for_test.c
+++ b/tests/src/fake_external_rng_for_test.c
@@ -23,34 +23,36 @@
#include <test/fake_external_rng_for_test.h>
#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
-#include <test/random.h>
-#include <psa/crypto.h>
+# include <test/random.h>
+# include <psa/crypto.h>
static int test_insecure_external_rng_enabled = 0;
-void mbedtls_test_enable_insecure_external_rng( void )
+void mbedtls_test_enable_insecure_external_rng(void)
{
test_insecure_external_rng_enabled = 1;
}
-void mbedtls_test_disable_insecure_external_rng( void )
+void mbedtls_test_disable_insecure_external_rng(void)
{
test_insecure_external_rng_enabled = 0;
}
-psa_status_t mbedtls_psa_external_get_random(
- mbedtls_psa_external_random_context_t *context,
- uint8_t *output, size_t output_size, size_t *output_length )
+psa_status_t
+mbedtls_psa_external_get_random(mbedtls_psa_external_random_context_t *context,
+ uint8_t *output,
+ size_t output_size,
+ size_t *output_length)
{
- (void) context;
+ (void)context;
- if( !test_insecure_external_rng_enabled )
- return PSA_ERROR_INSUFFICIENT_ENTROPY ;
+ if (!test_insecure_external_rng_enabled)
+ return PSA_ERROR_INSUFFICIENT_ENTROPY;
/* This implementation is for test purposes only!
* Use the libc non-cryptographic random generator. */
- mbedtls_test_rnd_std_rand( NULL, output, output_size );
+ mbedtls_test_rnd_std_rand(NULL, output, output_size);
*output_length = output_size;
- return PSA_SUCCESS ;
+ return PSA_SUCCESS;
}
#endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */
diff --git a/tests/src/helpers.c b/tests/src/helpers.c
index 7bbfa50..a41585a 100644
--- a/tests/src/helpers.c
+++ b/tests/src/helpers.c
@@ -31,40 +31,39 @@
/*----------------------------------------------------------------------------*/
/* Helper Functions */
-int mbedtls_test_platform_setup( void )
+int mbedtls_test_platform_setup(void)
{
int ret = 0;
#if defined(MBEDTLS_PLATFORM_C)
- ret = mbedtls_platform_setup( &platform_ctx );
+ ret = mbedtls_platform_setup(&platform_ctx);
#endif /* MBEDTLS_PLATFORM_C */
- return ret ;
+ return ret;
}
-void mbedtls_test_platform_teardown( void )
+void mbedtls_test_platform_teardown(void)
{
#if defined(MBEDTLS_PLATFORM_C)
- mbedtls_platform_teardown( &platform_ctx );
+ mbedtls_platform_teardown(&platform_ctx);
#endif /* MBEDTLS_PLATFORM_C */
}
static int ascii2uc(const char c, unsigned char *uc)
{
- if( ( c >= '0' ) && ( c <= '9' ) )
+ if ((c >= '0') && (c <= '9'))
*uc = c - '0';
- else if( ( c >= 'a' ) && ( c <= 'f' ) )
+ else if ((c >= 'a') && (c <= 'f'))
*uc = c - 'a' + 10;
- else if( ( c >= 'A' ) && ( c <= 'F' ) )
+ else if ((c >= 'A') && (c <= 'F'))
*uc = c - 'A' + 10;
else
- return -1 ;
+ return -1;
- return 0 ;
+ return 0;
}
-void mbedtls_test_fail( const char *test, int line_no, const char* filename )
+void mbedtls_test_fail(const char *test, int line_no, const char *filename)
{
- if( mbedtls_test_info.result == MBEDTLS_TEST_RESULT_FAILED )
- {
+ if (mbedtls_test_info.result == MBEDTLS_TEST_RESULT_FAILED) {
/* We've already recorded the test as having failed. Don't
* overwrite any previous information about the failure. */
return;
@@ -75,7 +74,7 @@
mbedtls_test_info.filename = filename;
}
-void mbedtls_test_skip( const char *test, int line_no, const char* filename )
+void mbedtls_test_skip(const char *test, int line_no, const char *filename)
{
mbedtls_test_info.result = MBEDTLS_TEST_RESULT_SKIPPED;
mbedtls_test_info.test = test;
@@ -83,68 +82,66 @@
mbedtls_test_info.filename = filename;
}
-void mbedtls_test_set_step( unsigned long step )
+void mbedtls_test_set_step(unsigned long step)
{
mbedtls_test_info.step = step;
}
-void mbedtls_test_info_reset( void )
+void mbedtls_test_info_reset(void)
{
mbedtls_test_info.result = MBEDTLS_TEST_RESULT_SUCCESS;
- mbedtls_test_info.step = (unsigned long)( -1 );
+ mbedtls_test_info.step = (unsigned long)(-1);
mbedtls_test_info.test = 0;
mbedtls_test_info.line_no = 0;
mbedtls_test_info.filename = 0;
}
-int mbedtls_test_unhexify( unsigned char *obuf,
- size_t obufmax,
- const char *ibuf,
- size_t *len )
+int mbedtls_test_unhexify(unsigned char *obuf,
+ size_t obufmax,
+ const char *ibuf,
+ size_t *len)
{
unsigned char uc, uc2;
- *len = strlen( ibuf );
+ *len = strlen(ibuf);
/* Must be even number of bytes. */
- if ( ( *len ) & 1 )
- return -1 ;
+ if ((*len) & 1)
+ return -1;
*len /= 2;
- if ( (*len) > obufmax )
- return -1 ;
+ if ((*len) > obufmax)
+ return -1;
- while( *ibuf != 0 )
- {
- if ( ascii2uc( *(ibuf++), &uc ) != 0 )
- return -1 ;
+ while (*ibuf != 0) {
+ if (ascii2uc(*(ibuf++), &uc) != 0)
+ return -1;
- if ( ascii2uc( *(ibuf++), &uc2 ) != 0 )
- return -1 ;
+ if (ascii2uc(*(ibuf++), &uc2) != 0)
+ return -1;
- *(obuf++) = ( uc << 4 ) | uc2;
+ *(obuf++) = (uc << 4) | uc2;
}
- return 0 ;
+ return 0;
}
-void mbedtls_test_hexify( unsigned char *obuf,
- const unsigned char *ibuf,
- int len )
+void mbedtls_test_hexify(unsigned char *obuf,
+ const unsigned char *ibuf,
+ int len)
{
unsigned char l, h;
- while( len != 0 )
- {
+ while (len != 0) {
h = *ibuf / 16;
l = *ibuf % 16;
- if( h < 10 )
+ if (h < 10)
*obuf++ = '0' + h;
else
*obuf++ = 'a' + h - 10;
- if( l < 10 )
+ if (l < 10)
*obuf++ = '0' + l;
else
*obuf++ = 'a' + l - 10;
@@ -154,49 +151,46 @@
}
}
-unsigned char *mbedtls_test_zero_alloc( size_t len )
+unsigned char *mbedtls_test_zero_alloc(size_t len)
{
void *p;
- size_t actual_len = ( len != 0 ) ? len : 1;
+ size_t actual_len = (len != 0) ? len : 1;
- p = mbedtls_calloc( 1, actual_len );
- TEST_HELPER_ASSERT( p != NULL );
+ p = mbedtls_calloc(1, actual_len);
+ TEST_HELPER_ASSERT(p != NULL);
- memset( p, 0x00, actual_len );
+ memset(p, 0x00, actual_len);
- return p ;
+ return p;
}
-unsigned char *mbedtls_test_unhexify_alloc( const char *ibuf, size_t *olen )
+unsigned char *mbedtls_test_unhexify_alloc(const char *ibuf, size_t *olen)
{
unsigned char *obuf;
size_t len;
- *olen = strlen( ibuf ) / 2;
+ *olen = strlen(ibuf) / 2;
- if( *olen == 0 )
- return mbedtls_test_zero_alloc( *olen ) ;
+ if (*olen == 0)
+ return mbedtls_test_zero_alloc(*olen);
- obuf = mbedtls_calloc( 1, *olen );
- TEST_HELPER_ASSERT( obuf != NULL );
- TEST_HELPER_ASSERT( mbedtls_test_unhexify( obuf, *olen, ibuf, &len ) == 0 );
+ obuf = mbedtls_calloc(1, *olen);
+ TEST_HELPER_ASSERT(obuf != NULL);
+ TEST_HELPER_ASSERT(mbedtls_test_unhexify(obuf, *olen, ibuf, &len) == 0);
- return obuf ;
+ return obuf;
}
-int mbedtls_test_hexcmp( uint8_t * a, uint8_t * b,
- uint32_t a_len, uint32_t b_len )
+int mbedtls_test_hexcmp(uint8_t *a, uint8_t *b, uint32_t a_len, uint32_t b_len)
{
int ret = 0;
uint32_t i = 0;
- if( a_len != b_len )
- return -1 ;
+ if (a_len != b_len)
+ return -1;
- for( i = 0; i < a_len; i++ )
- {
- if( a[i] != b[i] )
- {
+ for (i = 0; i < a_len; i++) {
+ if (a[i] != b[i]) {
ret = -1;
break;
}
@@ -205,8 +199,7 @@
}
#if defined(MBEDTLS_TEST_HOOKS)
-void mbedtls_test_err_add_check( int high, int low,
- const char *file, int line )
+void mbedtls_test_err_add_check(int high, int low, const char *file, int line)
{
/* Error codes are always negative (a value of zero is a success) however
* their positive opposites can be easier to understand. The following
@@ -220,57 +213,47 @@
* and module-dependent error code (bits 7..11)).
* l = low level error code.
*/
- if ( high > -0x1000 && high != 0 )
+ if (high > -0x1000 && high != 0)
/* high < 0001000000000000
* No high level module ID bits are set.
*/
{
- mbedtls_test_fail( "'high' is not a high-level error code",
- line, file );
- }
- else if ( high < -0x7F80 )
+ mbedtls_test_fail("'high' is not a high-level error code", line, file);
+ } else if (high < -0x7F80)
/* high > 0111111110000000
* Error code is greater than the largest allowed high level module ID.
*/
{
- mbedtls_test_fail( "'high' error code is greater than 15 bits",
- line, file );
- }
- else if ( ( high & 0x7F ) != 0 )
+ mbedtls_test_fail("'high' error code is greater than 15 bits", line,
+ file);
+ } else if ((high & 0x7F) != 0)
/* high & 0000000001111111
* Error code contains low level error code bits.
*/
{
- mbedtls_test_fail( "'high' contains a low-level error code",
- line, file );
- }
- else if ( low < -0x007F )
+ mbedtls_test_fail("'high' contains a low-level error code", line, file);
+ } else if (low < -0x007F)
/* low > 0000000001111111
* Error code contains high or module level error code bits.
*/
{
- mbedtls_test_fail( "'low' error code is greater than 7 bits",
- line, file );
- }
- else if ( low > 0 )
- {
- mbedtls_test_fail( "'low' error code is greater than zero",
- line, file );
+ mbedtls_test_fail("'low' error code is greater than 7 bits", line,
+ file);
+ } else if (low > 0) {
+ mbedtls_test_fail("'low' error code is greater than zero", line, file);
}
}
#endif /* MBEDTLS_TEST_HOOKS */
#if defined(MBEDTLS_BIGNUM_C)
-int mbedtls_test_read_mpi( mbedtls_mpi *X, int radix, const char *s )
+int mbedtls_test_read_mpi(mbedtls_mpi *X, int radix, const char *s)
{
/* mbedtls_mpi_read_string() currently retains leading zeros.
* It always allocates at least one limb for the value 0. */
- if( s[0] == 0 )
- {
- mbedtls_mpi_free( X );
- return 0 ;
- }
- else
- return mbedtls_mpi_read_string( X, radix, s ) ;
+ if (s[0] == 0) {
+ mbedtls_mpi_free(X);
+ return 0;
+ } else
+ return mbedtls_mpi_read_string(X, radix, s);
}
#endif
diff --git a/tests/src/psa_crypto_helpers.c b/tests/src/psa_crypto_helpers.c
index cef4093..147929e 100644
--- a/tests/src/psa_crypto_helpers.c
+++ b/tests/src/psa_crypto_helpers.c
@@ -26,105 +26,104 @@
#if defined(MBEDTLS_PSA_CRYPTO_C)
-#include <psa/crypto.h>
+# include <psa/crypto.h>
-#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
+# if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
-#include <psa_crypto_storage.h>
+# include <psa_crypto_storage.h>
static mbedtls_svc_key_id_t key_ids_used_in_test[9];
static size_t num_key_ids_used;
-int mbedtls_test_uses_key_id( mbedtls_svc_key_id_t key_id )
+int mbedtls_test_uses_key_id(mbedtls_svc_key_id_t key_id)
{
size_t i;
- if( MBEDTLS_SVC_KEY_ID_GET_KEY_ID( key_id ) >
- PSA_MAX_PERSISTENT_KEY_IDENTIFIER )
- {
+ if (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(key_id) >
+ PSA_MAX_PERSISTENT_KEY_IDENTIFIER) {
/* Don't touch key id values that designate non-key files. */
- return 1 ;
+ return 1;
}
- for( i = 0; i < num_key_ids_used ; i++ )
- {
- if( mbedtls_svc_key_id_equal( key_id, key_ids_used_in_test[i] ) )
- return 1 ;
+ for (i = 0; i < num_key_ids_used; i++) {
+ if (mbedtls_svc_key_id_equal(key_id, key_ids_used_in_test[i]))
+ return 1;
}
- if( num_key_ids_used == ARRAY_LENGTH( key_ids_used_in_test ) )
- return 0 ;
+ if (num_key_ids_used == ARRAY_LENGTH(key_ids_used_in_test))
+ return 0;
key_ids_used_in_test[num_key_ids_used] = key_id;
++num_key_ids_used;
- return 1 ;
+ return 1;
}
-void mbedtls_test_psa_purge_key_storage( void )
+void mbedtls_test_psa_purge_key_storage(void)
{
size_t i;
- for( i = 0; i < num_key_ids_used; i++ )
- psa_destroy_persistent_key( key_ids_used_in_test[i] );
+ for (i = 0; i < num_key_ids_used; i++)
+ psa_destroy_persistent_key(key_ids_used_in_test[i]);
num_key_ids_used = 0;
}
-void mbedtls_test_psa_purge_key_cache( void )
+void mbedtls_test_psa_purge_key_cache(void)
{
size_t i;
- for( i = 0; i < num_key_ids_used; i++ )
- psa_purge_key( key_ids_used_in_test[i] );
+ for (i = 0; i < num_key_ids_used; i++)
+ psa_purge_key(key_ids_used_in_test[i]);
}
-#endif /* MBEDTLS_PSA_CRYPTO_STORAGE_C */
+# endif /* MBEDTLS_PSA_CRYPTO_STORAGE_C */
-const char *mbedtls_test_helper_is_psa_leaking( void )
+const char *mbedtls_test_helper_is_psa_leaking(void)
{
mbedtls_psa_stats_t stats;
- mbedtls_psa_get_stats( &stats );
+ mbedtls_psa_get_stats(&stats);
- if( stats.volatile_slots != 0 )
- return "A volatile slot has not been closed properly." ;
- if( stats.persistent_slots != 0 )
- return "A persistent slot has not been closed properly." ;
- if( stats.external_slots != 0 )
- return "An external slot has not been closed properly." ;
- if( stats.half_filled_slots != 0 )
- return "A half-filled slot has not been cleared properly." ;
- if( stats.locked_slots != 0 )
- return "Some slots are still marked as locked." ;
+ if (stats.volatile_slots != 0)
+ return "A volatile slot has not been closed properly.";
+ if (stats.persistent_slots != 0)
+ return "A persistent slot has not been closed properly.";
+ if (stats.external_slots != 0)
+ return "An external slot has not been closed properly.";
+ if (stats.half_filled_slots != 0)
+ return "A half-filled slot has not been cleared properly.";
+ if (stats.locked_slots != 0)
+ return "Some slots are still marked as locked.";
- return NULL ;
+ return NULL;
}
-#if defined(RECORD_PSA_STATUS_COVERAGE_LOG)
+# if defined(RECORD_PSA_STATUS_COVERAGE_LOG)
/** Name of the file where return statuses are logged by #RECORD_STATUS. */
-#define STATUS_LOG_FILE_NAME "statuses.log"
+# define STATUS_LOG_FILE_NAME "statuses.log"
-psa_status_t mbedtls_test_record_status( psa_status_t status,
- const char *func,
- const char *file, int line,
- const char *expr )
+psa_status_t mbedtls_test_record_status(psa_status_t status,
+ const char *func,
+ const char *file,
+ int line,
+ const char *expr)
{
/* We open the log file on first use.
* We never close the log file, so the record_status feature is not
* compatible with resource leak detectors such as Asan.
*/
static FILE *log;
- if( log == NULL )
- log = fopen( STATUS_LOG_FILE_NAME, "a" );
- fprintf( log, "%d:%s:%s:%d:%s\n", (int) status, func, file, line, expr );
- return status ;
+ if (log == NULL)
+ log = fopen(STATUS_LOG_FILE_NAME, "a");
+ fprintf(log, "%d:%s:%s:%d:%s\n", (int)status, func, file, line, expr);
+ return status;
}
-#endif /* defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
+# endif /* defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
-psa_key_usage_t mbedtls_test_update_key_usage_flags( psa_key_usage_t usage_flags )
+psa_key_usage_t mbedtls_test_update_key_usage_flags(psa_key_usage_t usage_flags)
{
psa_key_usage_t updated_usage = usage_flags;
- if( usage_flags & PSA_KEY_USAGE_SIGN_HASH )
+ if (usage_flags & PSA_KEY_USAGE_SIGN_HASH)
updated_usage |= PSA_KEY_USAGE_SIGN_MESSAGE;
- if( usage_flags & PSA_KEY_USAGE_VERIFY_HASH )
+ if (usage_flags & PSA_KEY_USAGE_VERIFY_HASH)
updated_usage |= PSA_KEY_USAGE_VERIFY_MESSAGE;
- return updated_usage ;
+ return updated_usage;
}
#endif /* MBEDTLS_PSA_CRYPTO_C */
diff --git a/tests/src/psa_exercise_key.c b/tests/src/psa_exercise_key.c
index f47f15a..c7c667f 100644
--- a/tests/src/psa_exercise_key.c
+++ b/tests/src/psa_exercise_key.c
@@ -25,21 +25,21 @@
#if defined(MBEDTLS_PSA_CRYPTO_C)
-#include <mbedtls/asn1.h>
-#include <psa/crypto.h>
+# include <mbedtls/asn1.h>
+# include <psa/crypto.h>
-#include <test/asn1_helpers.h>
-#include <test/psa_crypto_helpers.h>
+# include <test/asn1_helpers.h>
+# include <test/psa_crypto_helpers.h>
-#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
-static int lifetime_is_dynamic_secure_element( psa_key_lifetime_t lifetime )
+# if defined(MBEDTLS_PSA_CRYPTO_SE_C)
+static int lifetime_is_dynamic_secure_element(psa_key_lifetime_t lifetime)
{
- return( PSA_KEY_LIFETIME_GET_LOCATION( lifetime ) !=
- PSA_KEY_LOCATION_LOCAL_STORAGE );
+ return (PSA_KEY_LIFETIME_GET_LOCATION(lifetime) !=
+ PSA_KEY_LOCATION_LOCAL_STORAGE);
}
-#endif
+# endif
-static int check_key_attributes_sanity( mbedtls_svc_key_id_t key )
+static int check_key_attributes_sanity(mbedtls_svc_key_id_t key)
{
int ok = 0;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
@@ -48,58 +48,51 @@
psa_key_type_t type;
size_t bits;
- PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
- lifetime = psa_get_key_lifetime( &attributes );
- id = psa_get_key_id( &attributes );
- type = psa_get_key_type( &attributes );
- bits = psa_get_key_bits( &attributes );
+ PSA_ASSERT(psa_get_key_attributes(key, &attributes));
+ lifetime = psa_get_key_lifetime(&attributes);
+ id = psa_get_key_id(&attributes);
+ type = psa_get_key_type(&attributes);
+ bits = psa_get_key_bits(&attributes);
/* Persistence */
- if( PSA_KEY_LIFETIME_IS_VOLATILE( lifetime ) )
- {
+ if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) {
TEST_ASSERT(
- ( PSA_KEY_ID_VOLATILE_MIN <=
- MBEDTLS_SVC_KEY_ID_GET_KEY_ID( id ) ) &&
- ( MBEDTLS_SVC_KEY_ID_GET_KEY_ID( id ) <=
- PSA_KEY_ID_VOLATILE_MAX ) );
- }
- else
- {
+ (PSA_KEY_ID_VOLATILE_MIN <= MBEDTLS_SVC_KEY_ID_GET_KEY_ID(id)) &&
+ (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(id) <= PSA_KEY_ID_VOLATILE_MAX));
+ } else {
TEST_ASSERT(
- ( PSA_KEY_ID_USER_MIN <= MBEDTLS_SVC_KEY_ID_GET_KEY_ID( id ) ) &&
- ( MBEDTLS_SVC_KEY_ID_GET_KEY_ID( id ) <= PSA_KEY_ID_USER_MAX ) );
+ (PSA_KEY_ID_USER_MIN <= MBEDTLS_SVC_KEY_ID_GET_KEY_ID(id)) &&
+ (MBEDTLS_SVC_KEY_ID_GET_KEY_ID(id) <= PSA_KEY_ID_USER_MAX));
}
-#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
+# if defined(MBEDTLS_PSA_CRYPTO_SE_C)
/* randomly-generated 64-bit constant, should never appear in test data */
psa_key_slot_number_t slot_number = 0xec94d4a5058a1a21;
- psa_status_t status = psa_get_key_slot_number( &attributes, &slot_number );
- if( lifetime_is_dynamic_secure_element( lifetime ) )
- {
+ psa_status_t status = psa_get_key_slot_number(&attributes, &slot_number);
+ if (lifetime_is_dynamic_secure_element(lifetime)) {
/* Mbed Crypto currently always exposes the slot number to
* applications. This is not mandated by the PSA specification
* and may change in future versions. */
- TEST_EQUAL( status, 0 );
- TEST_ASSERT( slot_number != 0xec94d4a5058a1a21 );
+ TEST_EQUAL(status, 0);
+ TEST_ASSERT(slot_number != 0xec94d4a5058a1a21);
+ } else {
+ TEST_EQUAL(status, PSA_ERROR_INVALID_ARGUMENT);
}
- else
- {
- TEST_EQUAL( status, PSA_ERROR_INVALID_ARGUMENT );
- }
-#endif
+# endif
/* Type and size */
- TEST_ASSERT( type != 0 );
- TEST_ASSERT( bits != 0 );
- TEST_ASSERT( bits <= PSA_MAX_KEY_BITS );
- if( PSA_KEY_TYPE_IS_UNSTRUCTURED( type ) )
- TEST_ASSERT( bits % 8 == 0 );
+ TEST_ASSERT(type != 0);
+ TEST_ASSERT(bits != 0);
+ TEST_ASSERT(bits <= PSA_MAX_KEY_BITS);
+ if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type))
+ TEST_ASSERT(bits % 8 == 0);
/* MAX macros concerning specific key types */
- if( PSA_KEY_TYPE_IS_ECC( type ) )
- TEST_ASSERT( bits <= PSA_VENDOR_ECC_MAX_CURVE_BITS );
- else if( PSA_KEY_TYPE_IS_RSA( type ) )
- TEST_ASSERT( bits <= PSA_VENDOR_RSA_MAX_KEY_BITS );
- TEST_ASSERT( PSA_BLOCK_CIPHER_BLOCK_LENGTH( type ) <= PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE );
+ if (PSA_KEY_TYPE_IS_ECC(type))
+ TEST_ASSERT(bits <= PSA_VENDOR_ECC_MAX_CURVE_BITS);
+ else if (PSA_KEY_TYPE_IS_RSA(type))
+ TEST_ASSERT(bits <= PSA_VENDOR_RSA_MAX_KEY_BITS);
+ TEST_ASSERT(PSA_BLOCK_CIPHER_BLOCK_LENGTH(type) <=
+ PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE);
ok = 1;
@@ -108,400 +101,339 @@
* Key attributes may have been returned by psa_get_key_attributes()
* thus reset them as required.
*/
- psa_reset_key_attributes( &attributes );
+ psa_reset_key_attributes(&attributes);
- return ok ;
+ return ok;
}
-static int exercise_mac_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_mac_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT;
const unsigned char input[] = "foo";
- unsigned char mac[PSA_MAC_MAX_SIZE] = {0};
- size_t mac_length = sizeof( mac );
+ unsigned char mac[PSA_MAC_MAX_SIZE] = { 0 };
+ size_t mac_length = sizeof(mac);
/* Convert wildcard algorithm to exercisable algorithm */
- if( alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG )
- {
- alg = PSA_ALG_TRUNCATED_MAC( alg, PSA_MAC_TRUNCATED_LENGTH( alg ) );
+ if (alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) {
+ alg = PSA_ALG_TRUNCATED_MAC(alg, PSA_MAC_TRUNCATED_LENGTH(alg));
}
- if( usage & PSA_KEY_USAGE_SIGN_HASH )
- {
- PSA_ASSERT( psa_mac_sign_setup( &operation, key, alg ) );
- PSA_ASSERT( psa_mac_update( &operation,
- input, sizeof( input ) ) );
- PSA_ASSERT( psa_mac_sign_finish( &operation,
- mac, sizeof( mac ),
- &mac_length ) );
+ if (usage & PSA_KEY_USAGE_SIGN_HASH) {
+ PSA_ASSERT(psa_mac_sign_setup(&operation, key, alg));
+ PSA_ASSERT(psa_mac_update(&operation, input, sizeof(input)));
+ PSA_ASSERT(
+ psa_mac_sign_finish(&operation, mac, sizeof(mac), &mac_length));
}
- if( usage & PSA_KEY_USAGE_VERIFY_HASH )
- {
- psa_status_t verify_status =
- ( usage & PSA_KEY_USAGE_SIGN_HASH ?
- PSA_SUCCESS :
- PSA_ERROR_INVALID_SIGNATURE );
- PSA_ASSERT( psa_mac_verify_setup( &operation, key, alg ) );
- PSA_ASSERT( psa_mac_update( &operation,
- input, sizeof( input ) ) );
- TEST_EQUAL( psa_mac_verify_finish( &operation, mac, mac_length ),
- verify_status );
+ if (usage & PSA_KEY_USAGE_VERIFY_HASH) {
+ psa_status_t verify_status = (usage & PSA_KEY_USAGE_SIGN_HASH ?
+ PSA_SUCCESS :
+ PSA_ERROR_INVALID_SIGNATURE);
+ PSA_ASSERT(psa_mac_verify_setup(&operation, key, alg));
+ PSA_ASSERT(psa_mac_update(&operation, input, sizeof(input)));
+ TEST_EQUAL(psa_mac_verify_finish(&operation, mac, mac_length),
+ verify_status);
}
- return 1 ;
+ return 1;
exit:
- psa_mac_abort( &operation );
- return 0 ;
+ psa_mac_abort(&operation);
+ return 0;
}
-static int exercise_cipher_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_cipher_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT;
- unsigned char iv[16] = {0};
- size_t iv_length = sizeof( iv );
+ unsigned char iv[16] = { 0 };
+ size_t iv_length = sizeof(iv);
const unsigned char plaintext[16] = "Hello, world...";
unsigned char ciphertext[32] = "(wabblewebblewibblewobblewubble)";
- size_t ciphertext_length = sizeof( ciphertext );
- unsigned char decrypted[sizeof( ciphertext )];
+ size_t ciphertext_length = sizeof(ciphertext);
+ unsigned char decrypted[sizeof(ciphertext)];
size_t part_length;
- if( usage & PSA_KEY_USAGE_ENCRYPT )
- {
- PSA_ASSERT( psa_cipher_encrypt_setup( &operation, key, alg ) );
- PSA_ASSERT( psa_cipher_generate_iv( &operation,
- iv, sizeof( iv ),
- &iv_length ) );
- PSA_ASSERT( psa_cipher_update( &operation,
- plaintext, sizeof( plaintext ),
- ciphertext, sizeof( ciphertext ),
- &ciphertext_length ) );
- PSA_ASSERT( psa_cipher_finish( &operation,
- ciphertext + ciphertext_length,
- sizeof( ciphertext ) - ciphertext_length,
- &part_length ) );
+ if (usage & PSA_KEY_USAGE_ENCRYPT) {
+ PSA_ASSERT(psa_cipher_encrypt_setup(&operation, key, alg));
+ PSA_ASSERT(
+ psa_cipher_generate_iv(&operation, iv, sizeof(iv), &iv_length));
+ PSA_ASSERT(psa_cipher_update(&operation, plaintext, sizeof(plaintext),
+ ciphertext, sizeof(ciphertext),
+ &ciphertext_length));
+ PSA_ASSERT(psa_cipher_finish(&operation, ciphertext + ciphertext_length,
+ sizeof(ciphertext) - ciphertext_length,
+ &part_length));
ciphertext_length += part_length;
}
- if( usage & PSA_KEY_USAGE_DECRYPT )
- {
+ if (usage & PSA_KEY_USAGE_DECRYPT) {
psa_status_t status;
int maybe_invalid_padding = 0;
- if( ! ( usage & PSA_KEY_USAGE_ENCRYPT ) )
- {
+ if (!(usage & PSA_KEY_USAGE_ENCRYPT)) {
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
- PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
+ PSA_ASSERT(psa_get_key_attributes(key, &attributes));
/* This should be PSA_CIPHER_GET_IV_SIZE but the API doesn't
* have this macro yet. */
- iv_length = PSA_BLOCK_CIPHER_BLOCK_LENGTH(
- psa_get_key_type( &attributes ) );
- maybe_invalid_padding = ! PSA_ALG_IS_STREAM_CIPHER( alg );
- psa_reset_key_attributes( &attributes );
+ iv_length =
+ PSA_BLOCK_CIPHER_BLOCK_LENGTH(psa_get_key_type(&attributes));
+ maybe_invalid_padding = !PSA_ALG_IS_STREAM_CIPHER(alg);
+ psa_reset_key_attributes(&attributes);
}
- PSA_ASSERT( psa_cipher_decrypt_setup( &operation, key, alg ) );
- PSA_ASSERT( psa_cipher_set_iv( &operation,
- iv, iv_length ) );
- PSA_ASSERT( psa_cipher_update( &operation,
- ciphertext, ciphertext_length,
- decrypted, sizeof( decrypted ),
- &part_length ) );
- status = psa_cipher_finish( &operation,
- decrypted + part_length,
- sizeof( decrypted ) - part_length,
- &part_length );
+ PSA_ASSERT(psa_cipher_decrypt_setup(&operation, key, alg));
+ PSA_ASSERT(psa_cipher_set_iv(&operation, iv, iv_length));
+ PSA_ASSERT(psa_cipher_update(&operation, ciphertext, ciphertext_length,
+ decrypted, sizeof(decrypted),
+ &part_length));
+ status = psa_cipher_finish(&operation, decrypted + part_length,
+ sizeof(decrypted) - part_length,
+ &part_length);
/* For a stream cipher, all inputs are valid. For a block cipher,
* if the input is some aribtrary data rather than an actual
ciphertext, a padding error is likely. */
- if( maybe_invalid_padding )
- TEST_ASSERT( status == PSA_SUCCESS ||
- status == PSA_ERROR_INVALID_PADDING );
+ if (maybe_invalid_padding)
+ TEST_ASSERT(status == PSA_SUCCESS ||
+ status == PSA_ERROR_INVALID_PADDING);
else
- PSA_ASSERT( status );
+ PSA_ASSERT(status);
}
- return 1 ;
+ return 1;
exit:
- psa_cipher_abort( &operation );
- return 0 ;
+ psa_cipher_abort(&operation);
+ return 0;
}
-static int exercise_aead_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_aead_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
- unsigned char nonce[16] = {0};
- size_t nonce_length = sizeof( nonce );
+ unsigned char nonce[16] = { 0 };
+ size_t nonce_length = sizeof(nonce);
unsigned char plaintext[16] = "Hello, world...";
unsigned char ciphertext[48] = "(wabblewebblewibblewobblewubble)";
- size_t ciphertext_length = sizeof( ciphertext );
- size_t plaintext_length = sizeof( ciphertext );
+ size_t ciphertext_length = sizeof(ciphertext);
+ size_t plaintext_length = sizeof(ciphertext);
/* Convert wildcard algorithm to exercisable algorithm */
- if( alg & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG )
- {
- alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, PSA_ALG_AEAD_GET_TAG_LENGTH( alg ) );
+ if (alg & PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG) {
+ alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg,
+ PSA_ALG_AEAD_GET_TAG_LENGTH(alg));
}
/* Default IV length for AES-GCM is 12 bytes */
- if( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) ==
- PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_GCM, 0 ) )
- {
+ if (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0) ==
+ PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0)) {
nonce_length = 12;
}
/* IV length for CCM needs to be between 7 and 13 bytes */
- if( PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 0 ) ==
- PSA_ALG_AEAD_WITH_SHORTENED_TAG( PSA_ALG_CCM, 0 ) )
- {
+ if (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0) ==
+ PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0)) {
nonce_length = 12;
}
- if( usage & PSA_KEY_USAGE_ENCRYPT )
- {
- PSA_ASSERT( psa_aead_encrypt( key, alg,
- nonce, nonce_length,
- NULL, 0,
- plaintext, sizeof( plaintext ),
- ciphertext, sizeof( ciphertext ),
- &ciphertext_length ) );
+ if (usage & PSA_KEY_USAGE_ENCRYPT) {
+ PSA_ASSERT(psa_aead_encrypt(key, alg, nonce, nonce_length, NULL, 0,
+ plaintext, sizeof(plaintext), ciphertext,
+ sizeof(ciphertext), &ciphertext_length));
}
- if( usage & PSA_KEY_USAGE_DECRYPT )
- {
- psa_status_t verify_status =
- ( usage & PSA_KEY_USAGE_ENCRYPT ?
- PSA_SUCCESS :
- PSA_ERROR_INVALID_SIGNATURE );
- TEST_EQUAL( psa_aead_decrypt( key, alg,
- nonce, nonce_length,
- NULL, 0,
- ciphertext, ciphertext_length,
- plaintext, sizeof( plaintext ),
- &plaintext_length ),
- verify_status );
+ if (usage & PSA_KEY_USAGE_DECRYPT) {
+ psa_status_t verify_status = (usage & PSA_KEY_USAGE_ENCRYPT ?
+ PSA_SUCCESS :
+ PSA_ERROR_INVALID_SIGNATURE);
+ TEST_EQUAL(psa_aead_decrypt(key, alg, nonce, nonce_length, NULL, 0,
+ ciphertext, ciphertext_length, plaintext,
+ sizeof(plaintext), &plaintext_length),
+ verify_status);
}
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
-static int exercise_signature_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_signature_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
- if( usage & ( PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_VERIFY_HASH ) )
- {
- unsigned char payload[PSA_HASH_MAX_SIZE] = {1};
+ if (usage & (PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_VERIFY_HASH)) {
+ unsigned char payload[PSA_HASH_MAX_SIZE] = { 1 };
size_t payload_length = 16;
- unsigned char signature[PSA_SIGNATURE_MAX_SIZE] = {0};
- size_t signature_length = sizeof( signature );
- psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH( alg );
+ unsigned char signature[PSA_SIGNATURE_MAX_SIZE] = { 0 };
+ size_t signature_length = sizeof(signature);
+ psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH(alg);
/* If the policy allows signing with any hash, just pick one. */
- if( PSA_ALG_IS_HASH_AND_SIGN( alg ) && hash_alg == PSA_ALG_ANY_HASH )
- {
- #if defined(KNOWN_SUPPORTED_HASH_ALG)
+ if (PSA_ALG_IS_HASH_AND_SIGN(alg) && hash_alg == PSA_ALG_ANY_HASH) {
+# if defined(KNOWN_SUPPORTED_HASH_ALG)
hash_alg = KNOWN_SUPPORTED_HASH_ALG;
alg ^= PSA_ALG_ANY_HASH ^ hash_alg;
- #else
- TEST_ASSERT( ! "No hash algorithm for hash-and-sign testing" );
- #endif
+# else
+ TEST_ASSERT(!"No hash algorithm for hash-and-sign testing");
+# endif
}
/* Some algorithms require the payload to have the size of
* the hash encoded in the algorithm. Use this input size
* even for algorithms that allow other input sizes. */
- if( hash_alg != 0 )
- payload_length = PSA_HASH_LENGTH( hash_alg );
+ if (hash_alg != 0)
+ payload_length = PSA_HASH_LENGTH(hash_alg);
- if( usage & PSA_KEY_USAGE_SIGN_HASH )
- {
- PSA_ASSERT( psa_sign_hash( key, alg,
- payload, payload_length,
- signature, sizeof( signature ),
- &signature_length ) );
+ if (usage & PSA_KEY_USAGE_SIGN_HASH) {
+ PSA_ASSERT(psa_sign_hash(key, alg, payload, payload_length,
+ signature, sizeof(signature),
+ &signature_length));
}
- if( usage & PSA_KEY_USAGE_VERIFY_HASH )
- {
- psa_status_t verify_status =
- ( usage & PSA_KEY_USAGE_SIGN_HASH ?
- PSA_SUCCESS :
- PSA_ERROR_INVALID_SIGNATURE );
- TEST_EQUAL( psa_verify_hash( key, alg,
- payload, payload_length,
- signature, signature_length ),
- verify_status );
+ if (usage & PSA_KEY_USAGE_VERIFY_HASH) {
+ psa_status_t verify_status = (usage & PSA_KEY_USAGE_SIGN_HASH ?
+ PSA_SUCCESS :
+ PSA_ERROR_INVALID_SIGNATURE);
+ TEST_EQUAL(psa_verify_hash(key, alg, payload, payload_length,
+ signature, signature_length),
+ verify_status);
}
}
- if( usage & ( PSA_KEY_USAGE_SIGN_MESSAGE | PSA_KEY_USAGE_VERIFY_MESSAGE ) )
- {
+ if (usage & (PSA_KEY_USAGE_SIGN_MESSAGE | PSA_KEY_USAGE_VERIFY_MESSAGE)) {
unsigned char message[256] = "Hello, world...";
- unsigned char signature[PSA_SIGNATURE_MAX_SIZE] = {0};
+ unsigned char signature[PSA_SIGNATURE_MAX_SIZE] = { 0 };
size_t message_length = 16;
- size_t signature_length = sizeof( signature );
+ size_t signature_length = sizeof(signature);
- if( usage & PSA_KEY_USAGE_SIGN_MESSAGE )
- {
- PSA_ASSERT( psa_sign_message( key, alg,
- message, message_length,
- signature, sizeof( signature ),
- &signature_length ) );
+ if (usage & PSA_KEY_USAGE_SIGN_MESSAGE) {
+ PSA_ASSERT(psa_sign_message(key, alg, message, message_length,
+ signature, sizeof(signature),
+ &signature_length));
}
- if( usage & PSA_KEY_USAGE_VERIFY_MESSAGE )
- {
- psa_status_t verify_status =
- ( usage & PSA_KEY_USAGE_SIGN_MESSAGE ?
- PSA_SUCCESS :
- PSA_ERROR_INVALID_SIGNATURE );
- TEST_EQUAL( psa_verify_message( key, alg,
- message, message_length,
- signature, signature_length ),
- verify_status );
+ if (usage & PSA_KEY_USAGE_VERIFY_MESSAGE) {
+ psa_status_t verify_status = (usage & PSA_KEY_USAGE_SIGN_MESSAGE ?
+ PSA_SUCCESS :
+ PSA_ERROR_INVALID_SIGNATURE);
+ TEST_EQUAL(psa_verify_message(key, alg, message, message_length,
+ signature, signature_length),
+ verify_status);
}
}
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
-static int exercise_asymmetric_encryption_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_asymmetric_encryption_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
unsigned char plaintext[256] = "Hello, world...";
unsigned char ciphertext[256] = "(wabblewebblewibblewobblewubble)";
- size_t ciphertext_length = sizeof( ciphertext );
+ size_t ciphertext_length = sizeof(ciphertext);
size_t plaintext_length = 16;
- if( usage & PSA_KEY_USAGE_ENCRYPT )
- {
- PSA_ASSERT( psa_asymmetric_encrypt( key, alg,
- plaintext, plaintext_length,
- NULL, 0,
- ciphertext, sizeof( ciphertext ),
- &ciphertext_length ) );
+ if (usage & PSA_KEY_USAGE_ENCRYPT) {
+ PSA_ASSERT(psa_asymmetric_encrypt(
+ key, alg, plaintext, plaintext_length, NULL, 0, ciphertext,
+ sizeof(ciphertext), &ciphertext_length));
}
- if( usage & PSA_KEY_USAGE_DECRYPT )
- {
- psa_status_t status =
- psa_asymmetric_decrypt( key, alg,
- ciphertext, ciphertext_length,
- NULL, 0,
- plaintext, sizeof( plaintext ),
- &plaintext_length );
- TEST_ASSERT( status == PSA_SUCCESS ||
- ( ( usage & PSA_KEY_USAGE_ENCRYPT ) == 0 &&
- ( status == PSA_ERROR_INVALID_ARGUMENT ||
- status == PSA_ERROR_INVALID_PADDING ) ) );
+ if (usage & PSA_KEY_USAGE_DECRYPT) {
+ psa_status_t status = psa_asymmetric_decrypt(
+ key, alg, ciphertext, ciphertext_length, NULL, 0, plaintext,
+ sizeof(plaintext), &plaintext_length);
+ TEST_ASSERT(status == PSA_SUCCESS ||
+ ((usage & PSA_KEY_USAGE_ENCRYPT) == 0 &&
+ (status == PSA_ERROR_INVALID_ARGUMENT ||
+ status == PSA_ERROR_INVALID_PADDING)));
}
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
int mbedtls_test_psa_setup_key_derivation_wrap(
- psa_key_derivation_operation_t* operation,
+ psa_key_derivation_operation_t *operation,
mbedtls_svc_key_id_t key,
psa_algorithm_t alg,
- const unsigned char* input1, size_t input1_length,
- const unsigned char* input2, size_t input2_length,
- size_t capacity )
+ const unsigned char *input1,
+ size_t input1_length,
+ const unsigned char *input2,
+ size_t input2_length,
+ size_t capacity)
{
- PSA_ASSERT( psa_key_derivation_setup( operation, alg ) );
- if( PSA_ALG_IS_HKDF( alg ) )
- {
- PSA_ASSERT( psa_key_derivation_input_bytes( operation,
- PSA_KEY_DERIVATION_INPUT_SALT,
- input1, input1_length ) );
- PSA_ASSERT( psa_key_derivation_input_key( operation,
- PSA_KEY_DERIVATION_INPUT_SECRET,
- key ) );
- PSA_ASSERT( psa_key_derivation_input_bytes( operation,
- PSA_KEY_DERIVATION_INPUT_INFO,
- input2,
- input2_length ) );
- }
- else if( PSA_ALG_IS_TLS12_PRF( alg ) ||
- PSA_ALG_IS_TLS12_PSK_TO_MS( alg ) )
- {
- PSA_ASSERT( psa_key_derivation_input_bytes( operation,
- PSA_KEY_DERIVATION_INPUT_SEED,
- input1, input1_length ) );
- PSA_ASSERT( psa_key_derivation_input_key( operation,
- PSA_KEY_DERIVATION_INPUT_SECRET,
- key ) );
- PSA_ASSERT( psa_key_derivation_input_bytes( operation,
- PSA_KEY_DERIVATION_INPUT_LABEL,
- input2, input2_length ) );
- }
- else
- {
- TEST_ASSERT( ! "Key derivation algorithm not supported" );
+ PSA_ASSERT(psa_key_derivation_setup(operation, alg));
+ if (PSA_ALG_IS_HKDF(alg)) {
+ PSA_ASSERT(psa_key_derivation_input_bytes(
+ operation, PSA_KEY_DERIVATION_INPUT_SALT, input1, input1_length));
+ PSA_ASSERT(psa_key_derivation_input_key(
+ operation, PSA_KEY_DERIVATION_INPUT_SECRET, key));
+ PSA_ASSERT(psa_key_derivation_input_bytes(
+ operation, PSA_KEY_DERIVATION_INPUT_INFO, input2, input2_length));
+ } else if (PSA_ALG_IS_TLS12_PRF(alg) || PSA_ALG_IS_TLS12_PSK_TO_MS(alg)) {
+ PSA_ASSERT(psa_key_derivation_input_bytes(
+ operation, PSA_KEY_DERIVATION_INPUT_SEED, input1, input1_length));
+ PSA_ASSERT(psa_key_derivation_input_key(
+ operation, PSA_KEY_DERIVATION_INPUT_SECRET, key));
+ PSA_ASSERT(psa_key_derivation_input_bytes(
+ operation, PSA_KEY_DERIVATION_INPUT_LABEL, input2, input2_length));
+ } else {
+ TEST_ASSERT(!"Key derivation algorithm not supported");
}
- if( capacity != SIZE_MAX )
- PSA_ASSERT( psa_key_derivation_set_capacity( operation, capacity ) );
+ if (capacity != SIZE_MAX)
+ PSA_ASSERT(psa_key_derivation_set_capacity(operation, capacity));
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
-
-static int exercise_key_derivation_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_key_derivation_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
- psa_key_derivation_operation_t operation = PSA_KEY_DERIVATION_OPERATION_INIT;
+ psa_key_derivation_operation_t operation =
+ PSA_KEY_DERIVATION_OPERATION_INIT;
unsigned char input1[] = "Input 1";
- size_t input1_length = sizeof( input1 );
+ size_t input1_length = sizeof(input1);
unsigned char input2[] = "Input 2";
- size_t input2_length = sizeof( input2 );
+ size_t input2_length = sizeof(input2);
unsigned char output[1];
- size_t capacity = sizeof( output );
+ size_t capacity = sizeof(output);
- if( usage & PSA_KEY_USAGE_DERIVE )
- {
- if( !mbedtls_test_psa_setup_key_derivation_wrap( &operation, key, alg,
- input1, input1_length,
- input2, input2_length,
- capacity ) )
+ if (usage & PSA_KEY_USAGE_DERIVE) {
+ if (!mbedtls_test_psa_setup_key_derivation_wrap(
+ &operation, key, alg, input1, input1_length, input2,
+ input2_length, capacity))
goto exit;
- PSA_ASSERT( psa_key_derivation_output_bytes( &operation,
- output,
- capacity ) );
- PSA_ASSERT( psa_key_derivation_abort( &operation ) );
+ PSA_ASSERT(
+ psa_key_derivation_output_bytes(&operation, output, capacity));
+ PSA_ASSERT(psa_key_derivation_abort(&operation));
}
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
/* We need two keys to exercise key agreement. Exercise the
* private key against its own public key. */
psa_status_t mbedtls_test_psa_key_agreement_with_self(
psa_key_derivation_operation_t *operation,
- mbedtls_svc_key_id_t key )
+ mbedtls_svc_key_id_t key)
{
psa_key_type_t private_key_type;
psa_key_type_t public_key_type;
@@ -514,34 +446,36 @@
psa_status_t status = PSA_ERROR_GENERIC_ERROR;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
- PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
- private_key_type = psa_get_key_type( &attributes );
- key_bits = psa_get_key_bits( &attributes );
- public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR( private_key_type );
- public_key_length = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE( public_key_type, key_bits );
- ASSERT_ALLOC( public_key, public_key_length );
- PSA_ASSERT( psa_export_public_key( key, public_key, public_key_length,
- &public_key_length ) );
+ PSA_ASSERT(psa_get_key_attributes(key, &attributes));
+ private_key_type = psa_get_key_type(&attributes);
+ key_bits = psa_get_key_bits(&attributes);
+ public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(private_key_type);
+ public_key_length =
+ PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(public_key_type, key_bits);
+ ASSERT_ALLOC(public_key, public_key_length);
+ PSA_ASSERT(psa_export_public_key(key, public_key, public_key_length,
+ &public_key_length));
- status = psa_key_derivation_key_agreement(
- operation, PSA_KEY_DERIVATION_INPUT_SECRET, key,
- public_key, public_key_length );
+ status = psa_key_derivation_key_agreement(operation,
+ PSA_KEY_DERIVATION_INPUT_SECRET,
+ key, public_key,
+ public_key_length);
exit:
/*
* Key attributes may have been returned by psa_get_key_attributes()
* thus reset them as required.
*/
- psa_reset_key_attributes( &attributes );
+ psa_reset_key_attributes(&attributes);
- mbedtls_free( public_key );
- return status ;
+ mbedtls_free(public_key);
+ return status;
}
/* We need two keys to exercise key agreement. Exercise the
* private key against its own public key. */
-psa_status_t mbedtls_test_psa_raw_key_agreement_with_self(
- psa_algorithm_t alg,
- mbedtls_svc_key_id_t key )
+psa_status_t
+mbedtls_test_psa_raw_key_agreement_with_self(psa_algorithm_t alg,
+ mbedtls_svc_key_id_t key)
{
psa_key_type_t private_key_type;
psa_key_type_t public_key_type;
@@ -556,26 +490,22 @@
psa_status_t status = PSA_ERROR_GENERIC_ERROR;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
- PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
- private_key_type = psa_get_key_type( &attributes );
- key_bits = psa_get_key_bits( &attributes );
- public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR( private_key_type );
- public_key_length = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE( public_key_type, key_bits );
- ASSERT_ALLOC( public_key, public_key_length );
- PSA_ASSERT( psa_export_public_key( key,
- public_key, public_key_length,
- &public_key_length ) );
+ PSA_ASSERT(psa_get_key_attributes(key, &attributes));
+ private_key_type = psa_get_key_type(&attributes);
+ key_bits = psa_get_key_bits(&attributes);
+ public_key_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(private_key_type);
+ public_key_length =
+ PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(public_key_type, key_bits);
+ ASSERT_ALLOC(public_key, public_key_length);
+ PSA_ASSERT(psa_export_public_key(key, public_key, public_key_length,
+ &public_key_length));
- status = psa_raw_key_agreement( alg, key,
- public_key, public_key_length,
- output, sizeof( output ), &output_length );
- if ( status == PSA_SUCCESS )
- {
- TEST_ASSERT( output_length <=
- PSA_RAW_KEY_AGREEMENT_OUTPUT_SIZE( private_key_type,
- key_bits ) );
- TEST_ASSERT( output_length <=
- PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE );
+ status = psa_raw_key_agreement(alg, key, public_key, public_key_length,
+ output, sizeof(output), &output_length);
+ if (status == PSA_SUCCESS) {
+ TEST_ASSERT(output_length <= PSA_RAW_KEY_AGREEMENT_OUTPUT_SIZE(
+ private_key_type, key_bits));
+ TEST_ASSERT(output_length <= PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE);
}
exit:
@@ -583,69 +513,66 @@
* Key attributes may have been returned by psa_get_key_attributes()
* thus reset them as required.
*/
- psa_reset_key_attributes( &attributes );
+ psa_reset_key_attributes(&attributes);
- mbedtls_free( public_key );
- return status ;
+ mbedtls_free(public_key);
+ return status;
}
-static int exercise_raw_key_agreement_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_raw_key_agreement_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
int ok = 0;
- if( usage & PSA_KEY_USAGE_DERIVE )
- {
+ if (usage & PSA_KEY_USAGE_DERIVE) {
/* We need two keys to exercise key agreement. Exercise the
* private key against its own public key. */
- PSA_ASSERT( mbedtls_test_psa_raw_key_agreement_with_self( alg, key ) );
+ PSA_ASSERT(mbedtls_test_psa_raw_key_agreement_with_self(alg, key));
}
ok = 1;
exit:
- return ok ;
+ return ok;
}
-static int exercise_key_agreement_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+static int exercise_key_agreement_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
- psa_key_derivation_operation_t operation = PSA_KEY_DERIVATION_OPERATION_INIT;
+ psa_key_derivation_operation_t operation =
+ PSA_KEY_DERIVATION_OPERATION_INIT;
unsigned char output[1];
int ok = 0;
- if( usage & PSA_KEY_USAGE_DERIVE )
- {
+ if (usage & PSA_KEY_USAGE_DERIVE) {
/* We need two keys to exercise key agreement. Exercise the
* private key against its own public key. */
- PSA_ASSERT( psa_key_derivation_setup( &operation, alg ) );
- PSA_ASSERT( mbedtls_test_psa_key_agreement_with_self( &operation, key ) );
- PSA_ASSERT( psa_key_derivation_output_bytes( &operation,
- output,
- sizeof( output ) ) );
- PSA_ASSERT( psa_key_derivation_abort( &operation ) );
+ PSA_ASSERT(psa_key_derivation_setup(&operation, alg));
+ PSA_ASSERT(mbedtls_test_psa_key_agreement_with_self(&operation, key));
+ PSA_ASSERT(psa_key_derivation_output_bytes(&operation, output,
+ sizeof(output)));
+ PSA_ASSERT(psa_key_derivation_abort(&operation));
}
ok = 1;
exit:
- return ok ;
+ return ok;
}
-int mbedtls_test_psa_exported_key_sanity_check(
- psa_key_type_t type, size_t bits,
- const uint8_t *exported, size_t exported_length )
+int mbedtls_test_psa_exported_key_sanity_check(psa_key_type_t type,
+ size_t bits,
+ const uint8_t *exported,
+ size_t exported_length)
{
- TEST_ASSERT( exported_length <= PSA_EXPORT_KEY_OUTPUT_SIZE( type, bits ) );
+ TEST_ASSERT(exported_length <= PSA_EXPORT_KEY_OUTPUT_SIZE(type, bits));
- if( PSA_KEY_TYPE_IS_UNSTRUCTURED( type ) )
- TEST_EQUAL( exported_length, PSA_BITS_TO_BYTES( bits ) );
+ if (PSA_KEY_TYPE_IS_UNSTRUCTURED(type))
+ TEST_EQUAL(exported_length, PSA_BITS_TO_BYTES(bits));
else
-
-#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_PK_PARSE_C)
- if( type == PSA_KEY_TYPE_RSA_KEY_PAIR )
- {
- uint8_t *p = (uint8_t*) exported;
+# if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_PK_PARSE_C)
+ if (type == PSA_KEY_TYPE_RSA_KEY_PAIR) {
+ uint8_t *p = (uint8_t *)exported;
const uint8_t *end = exported + exported_length;
size_t len;
/* RSAPrivateKey ::= SEQUENCE {
@@ -660,139 +587,123 @@
* coefficient INTEGER, -- (inverse of q) mod p
* }
*/
- TEST_EQUAL( mbedtls_asn1_get_tag( &p, end, &len,
- MBEDTLS_ASN1_SEQUENCE |
- MBEDTLS_ASN1_CONSTRUCTED ), 0 );
- TEST_EQUAL( p + len, end );
- if( ! mbedtls_test_asn1_skip_integer( &p, end, 0, 0, 0 ) )
+ TEST_EQUAL(mbedtls_asn1_get_tag(&p, end, &len,
+ MBEDTLS_ASN1_SEQUENCE |
+ MBEDTLS_ASN1_CONSTRUCTED),
+ 0);
+ TEST_EQUAL(p + len, end);
+ if (!mbedtls_test_asn1_skip_integer(&p, end, 0, 0, 0))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, bits, bits, 1 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, bits, bits, 1))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, 2, bits, 1 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, 2, bits, 1))
goto exit;
/* Require d to be at least half the size of n. */
- if( ! mbedtls_test_asn1_skip_integer( &p, end, bits / 2, bits, 1 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, bits / 2, bits, 1))
goto exit;
/* Require p and q to be at most half the size of n, rounded up. */
- if( ! mbedtls_test_asn1_skip_integer( &p, end, bits / 2, bits / 2 + 1, 1 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, bits / 2, bits / 2 + 1, 1))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, bits / 2, bits / 2 + 1, 1 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, bits / 2, bits / 2 + 1, 1))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, 1, bits / 2 + 1, 0 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, 1, bits / 2 + 1, 0))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, 1, bits / 2 + 1, 0 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, 1, bits / 2 + 1, 0))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, 1, bits / 2 + 1, 0 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, 1, bits / 2 + 1, 0))
goto exit;
- TEST_EQUAL( p, end );
+ TEST_EQUAL(p, end);
- TEST_ASSERT( exported_length <= PSA_EXPORT_KEY_PAIR_MAX_SIZE );
- }
- else
-#endif /* MBEDTLS_RSA_C */
+ TEST_ASSERT(exported_length <= PSA_EXPORT_KEY_PAIR_MAX_SIZE);
+ } else
+# endif /* MBEDTLS_RSA_C */
-#if defined(MBEDTLS_ECP_C)
- if( PSA_KEY_TYPE_IS_ECC_KEY_PAIR( type ) )
- {
+# if defined(MBEDTLS_ECP_C)
+ if (PSA_KEY_TYPE_IS_ECC_KEY_PAIR(type)) {
/* Just the secret value */
- TEST_EQUAL( exported_length, PSA_BITS_TO_BYTES( bits ) );
+ TEST_EQUAL(exported_length, PSA_BITS_TO_BYTES(bits));
- TEST_ASSERT( exported_length <= PSA_EXPORT_KEY_PAIR_MAX_SIZE );
- }
- else
-#endif /* MBEDTLS_ECP_C */
+ TEST_ASSERT(exported_length <= PSA_EXPORT_KEY_PAIR_MAX_SIZE);
+ } else
+# endif /* MBEDTLS_ECP_C */
-#if defined(MBEDTLS_RSA_C)
- if( type == PSA_KEY_TYPE_RSA_PUBLIC_KEY )
- {
- uint8_t *p = (uint8_t*) exported;
+# if defined(MBEDTLS_RSA_C)
+ if (type == PSA_KEY_TYPE_RSA_PUBLIC_KEY) {
+ uint8_t *p = (uint8_t *)exported;
const uint8_t *end = exported + exported_length;
size_t len;
/* RSAPublicKey ::= SEQUENCE {
* modulus INTEGER, -- n
* publicExponent INTEGER } -- e
*/
- TEST_EQUAL( mbedtls_asn1_get_tag( &p, end, &len,
- MBEDTLS_ASN1_SEQUENCE |
- MBEDTLS_ASN1_CONSTRUCTED ),
- 0 );
- TEST_EQUAL( p + len, end );
- if( ! mbedtls_test_asn1_skip_integer( &p, end, bits, bits, 1 ) )
+ TEST_EQUAL(mbedtls_asn1_get_tag(&p, end, &len,
+ MBEDTLS_ASN1_SEQUENCE |
+ MBEDTLS_ASN1_CONSTRUCTED),
+ 0);
+ TEST_EQUAL(p + len, end);
+ if (!mbedtls_test_asn1_skip_integer(&p, end, bits, bits, 1))
goto exit;
- if( ! mbedtls_test_asn1_skip_integer( &p, end, 2, bits, 1 ) )
+ if (!mbedtls_test_asn1_skip_integer(&p, end, 2, bits, 1))
goto exit;
- TEST_EQUAL( p, end );
+ TEST_EQUAL(p, end);
+ TEST_ASSERT(exported_length <=
+ PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(type, bits));
+ TEST_ASSERT(exported_length <= PSA_EXPORT_PUBLIC_KEY_MAX_SIZE);
+ } else
+# endif /* MBEDTLS_RSA_C */
- TEST_ASSERT( exported_length <=
- PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE( type, bits ) );
- TEST_ASSERT( exported_length <=
- PSA_EXPORT_PUBLIC_KEY_MAX_SIZE );
- }
- else
-#endif /* MBEDTLS_RSA_C */
+# if defined(MBEDTLS_ECP_C)
+ if (PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY(type)) {
-#if defined(MBEDTLS_ECP_C)
- if( PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY( type ) )
- {
+ TEST_ASSERT(exported_length <=
+ PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(type, bits));
+ TEST_ASSERT(exported_length <= PSA_EXPORT_PUBLIC_KEY_MAX_SIZE);
- TEST_ASSERT( exported_length <=
- PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE( type, bits ) );
- TEST_ASSERT( exported_length <=
- PSA_EXPORT_PUBLIC_KEY_MAX_SIZE );
-
- if( PSA_KEY_TYPE_ECC_GET_FAMILY( type ) == PSA_ECC_FAMILY_MONTGOMERY )
- {
+ if (PSA_KEY_TYPE_ECC_GET_FAMILY(type) == PSA_ECC_FAMILY_MONTGOMERY) {
/* The representation of an ECC Montgomery public key is
* the raw compressed point */
- TEST_EQUAL( PSA_BITS_TO_BYTES( bits ), exported_length );
- }
- else
- {
+ TEST_EQUAL(PSA_BITS_TO_BYTES(bits), exported_length);
+ } else {
/* The representation of an ECC Weierstrass public key is:
* - The byte 0x04;
* - `x_P` as a `ceiling(m/8)`-byte string, big-endian;
* - `y_P` as a `ceiling(m/8)`-byte string, big-endian;
* - where m is the bit size associated with the curve.
*/
- TEST_EQUAL( 1 + 2 * PSA_BITS_TO_BYTES( bits ), exported_length );
- TEST_EQUAL( exported[0], 4 );
+ TEST_EQUAL(1 + 2 * PSA_BITS_TO_BYTES(bits), exported_length);
+ TEST_EQUAL(exported[0], 4);
}
- }
- else
-#endif /* MBEDTLS_ECP_C */
+ } else
+# endif /* MBEDTLS_ECP_C */
{
- TEST_ASSERT( ! "Sanity check not implemented for this key type" );
+ TEST_ASSERT(!"Sanity check not implemented for this key type");
}
-#if defined(MBEDTLS_DES_C)
- if( type == PSA_KEY_TYPE_DES )
- {
+# if defined(MBEDTLS_DES_C)
+ if (type == PSA_KEY_TYPE_DES) {
/* Check the parity bits. */
unsigned i;
- for( i = 0; i < bits / 8; i++ )
- {
+ for (i = 0; i < bits / 8; i++) {
unsigned bit_count = 0;
unsigned m;
- for( m = 1; m <= 0x100; m <<= 1 )
- {
- if( exported[i] & m )
+ for (m = 1; m <= 0x100; m <<= 1) {
+ if (exported[i] & m)
++bit_count;
}
- TEST_ASSERT( bit_count % 2 != 0 );
+ TEST_ASSERT(bit_count % 2 != 0);
}
}
-#endif
+# endif
- return 1 ;
+ return 1;
exit:
- return 0 ;
+ return 0;
}
-static int exercise_export_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage )
+static int exercise_export_key(mbedtls_svc_key_id_t key, psa_key_usage_t usage)
{
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
uint8_t *exported = NULL;
@@ -800,42 +711,38 @@
size_t exported_length = 0;
int ok = 0;
- PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
+ PSA_ASSERT(psa_get_key_attributes(key, &attributes));
- exported_size = PSA_EXPORT_KEY_OUTPUT_SIZE(
- psa_get_key_type( &attributes ),
- psa_get_key_bits( &attributes ) );
- ASSERT_ALLOC( exported, exported_size );
+ exported_size = PSA_EXPORT_KEY_OUTPUT_SIZE(psa_get_key_type(&attributes),
+ psa_get_key_bits(&attributes));
+ ASSERT_ALLOC(exported, exported_size);
- if( ( usage & PSA_KEY_USAGE_EXPORT ) == 0 &&
- ! PSA_KEY_TYPE_IS_PUBLIC_KEY( psa_get_key_type( &attributes ) ) )
- {
- TEST_EQUAL( psa_export_key( key, exported,
- exported_size, &exported_length ),
- PSA_ERROR_NOT_PERMITTED );
+ if ((usage & PSA_KEY_USAGE_EXPORT) == 0 &&
+ !PSA_KEY_TYPE_IS_PUBLIC_KEY(psa_get_key_type(&attributes))) {
+ TEST_EQUAL(psa_export_key(key, exported, exported_size,
+ &exported_length),
+ PSA_ERROR_NOT_PERMITTED);
ok = 1;
goto exit;
}
- PSA_ASSERT( psa_export_key( key,
- exported, exported_size,
- &exported_length ) );
+ PSA_ASSERT(psa_export_key(key, exported, exported_size, &exported_length));
ok = mbedtls_test_psa_exported_key_sanity_check(
- psa_get_key_type( &attributes ), psa_get_key_bits( &attributes ),
- exported, exported_length );
+ psa_get_key_type(&attributes), psa_get_key_bits(&attributes), exported,
+ exported_length);
exit:
/*
* Key attributes may have been returned by psa_get_key_attributes()
* thus reset them as required.
*/
- psa_reset_key_attributes( &attributes );
+ psa_reset_key_attributes(&attributes);
- mbedtls_free( exported );
- return ok ;
+ mbedtls_free(exported);
+ return ok;
}
-static int exercise_export_public_key( mbedtls_svc_key_id_t key )
+static int exercise_export_public_key(mbedtls_svc_key_id_t key)
{
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
psa_key_type_t public_type;
@@ -844,121 +751,111 @@
size_t exported_length = 0;
int ok = 0;
- PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
- if( ! PSA_KEY_TYPE_IS_ASYMMETRIC( psa_get_key_type( &attributes ) ) )
- {
+ PSA_ASSERT(psa_get_key_attributes(key, &attributes));
+ if (!PSA_KEY_TYPE_IS_ASYMMETRIC(psa_get_key_type(&attributes))) {
exported_size = PSA_EXPORT_KEY_OUTPUT_SIZE(
- psa_get_key_type( &attributes ),
- psa_get_key_bits( &attributes ) );
- ASSERT_ALLOC( exported, exported_size );
+ psa_get_key_type(&attributes), psa_get_key_bits(&attributes));
+ ASSERT_ALLOC(exported, exported_size);
- TEST_EQUAL( psa_export_public_key( key, exported,
- exported_size, &exported_length ),
- PSA_ERROR_INVALID_ARGUMENT );
+ TEST_EQUAL(psa_export_public_key(key, exported, exported_size,
+ &exported_length),
+ PSA_ERROR_INVALID_ARGUMENT);
ok = 1;
goto exit;
}
- public_type = PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(
- psa_get_key_type( &attributes ) );
- exported_size = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE( public_type,
- psa_get_key_bits( &attributes ) );
- ASSERT_ALLOC( exported, exported_size );
+ public_type =
+ PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(psa_get_key_type(&attributes));
+ exported_size = PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(
+ public_type, psa_get_key_bits(&attributes));
+ ASSERT_ALLOC(exported, exported_size);
- PSA_ASSERT( psa_export_public_key( key,
- exported, exported_size,
- &exported_length ) );
+ PSA_ASSERT(
+ psa_export_public_key(key, exported, exported_size, &exported_length));
ok = mbedtls_test_psa_exported_key_sanity_check(
- public_type, psa_get_key_bits( &attributes ),
- exported, exported_length );
+ public_type, psa_get_key_bits(&attributes), exported, exported_length);
exit:
/*
* Key attributes may have been returned by psa_get_key_attributes()
* thus reset them as required.
*/
- psa_reset_key_attributes( &attributes );
+ psa_reset_key_attributes(&attributes);
- mbedtls_free( exported );
- return ok ;
+ mbedtls_free(exported);
+ return ok;
}
-int mbedtls_test_psa_exercise_key( mbedtls_svc_key_id_t key,
- psa_key_usage_t usage,
- psa_algorithm_t alg )
+int mbedtls_test_psa_exercise_key(mbedtls_svc_key_id_t key,
+ psa_key_usage_t usage,
+ psa_algorithm_t alg)
{
int ok = 0;
- if( ! check_key_attributes_sanity( key ) )
- return 0 ;
+ if (!check_key_attributes_sanity(key))
+ return 0;
- if( alg == 0 )
+ if (alg == 0)
ok = 1; /* If no algorihm, do nothing (used for raw data "keys"). */
- else if( PSA_ALG_IS_MAC( alg ) )
- ok = exercise_mac_key( key, usage, alg );
- else if( PSA_ALG_IS_CIPHER( alg ) )
- ok = exercise_cipher_key( key, usage, alg );
- else if( PSA_ALG_IS_AEAD( alg ) )
- ok = exercise_aead_key( key, usage, alg );
- else if( PSA_ALG_IS_SIGN( alg ) )
- ok = exercise_signature_key( key, usage, alg );
- else if( PSA_ALG_IS_ASYMMETRIC_ENCRYPTION( alg ) )
- ok = exercise_asymmetric_encryption_key( key, usage, alg );
- else if( PSA_ALG_IS_KEY_DERIVATION( alg ) )
- ok = exercise_key_derivation_key( key, usage, alg );
- else if( PSA_ALG_IS_RAW_KEY_AGREEMENT( alg ) )
- ok = exercise_raw_key_agreement_key( key, usage, alg );
- else if( PSA_ALG_IS_KEY_AGREEMENT( alg ) )
- ok = exercise_key_agreement_key( key, usage, alg );
+ else if (PSA_ALG_IS_MAC(alg))
+ ok = exercise_mac_key(key, usage, alg);
+ else if (PSA_ALG_IS_CIPHER(alg))
+ ok = exercise_cipher_key(key, usage, alg);
+ else if (PSA_ALG_IS_AEAD(alg))
+ ok = exercise_aead_key(key, usage, alg);
+ else if (PSA_ALG_IS_SIGN(alg))
+ ok = exercise_signature_key(key, usage, alg);
+ else if (PSA_ALG_IS_ASYMMETRIC_ENCRYPTION(alg))
+ ok = exercise_asymmetric_encryption_key(key, usage, alg);
+ else if (PSA_ALG_IS_KEY_DERIVATION(alg))
+ ok = exercise_key_derivation_key(key, usage, alg);
+ else if (PSA_ALG_IS_RAW_KEY_AGREEMENT(alg))
+ ok = exercise_raw_key_agreement_key(key, usage, alg);
+ else if (PSA_ALG_IS_KEY_AGREEMENT(alg))
+ ok = exercise_key_agreement_key(key, usage, alg);
else
- TEST_ASSERT( ! "No code to exercise this category of algorithm" );
+ TEST_ASSERT(!"No code to exercise this category of algorithm");
- ok = ok && exercise_export_key( key, usage );
- ok = ok && exercise_export_public_key( key );
+ ok = ok && exercise_export_key(key, usage);
+ ok = ok && exercise_export_public_key(key);
exit:
- return ok ;
+ return ok;
}
-psa_key_usage_t mbedtls_test_psa_usage_to_exercise( psa_key_type_t type,
- psa_algorithm_t alg )
+psa_key_usage_t mbedtls_test_psa_usage_to_exercise(psa_key_type_t type,
+ psa_algorithm_t alg)
{
- if( PSA_ALG_IS_MAC( alg ) || PSA_ALG_IS_SIGN( alg ) )
- {
- if( PSA_ALG_IS_HASH_AND_SIGN( alg ) )
- {
- if( PSA_ALG_SIGN_GET_HASH( alg ) )
- return( PSA_KEY_TYPE_IS_PUBLIC_KEY( type ) ?
- PSA_KEY_USAGE_VERIFY_HASH | PSA_KEY_USAGE_VERIFY_MESSAGE:
- PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_VERIFY_HASH |
- PSA_KEY_USAGE_SIGN_MESSAGE | PSA_KEY_USAGE_VERIFY_MESSAGE );
- }
- else if( PSA_ALG_IS_SIGN_MESSAGE( alg) )
- return( PSA_KEY_TYPE_IS_PUBLIC_KEY( type ) ?
- PSA_KEY_USAGE_VERIFY_MESSAGE :
- PSA_KEY_USAGE_SIGN_MESSAGE | PSA_KEY_USAGE_VERIFY_MESSAGE );
+ if (PSA_ALG_IS_MAC(alg) || PSA_ALG_IS_SIGN(alg)) {
+ if (PSA_ALG_IS_HASH_AND_SIGN(alg)) {
+ if (PSA_ALG_SIGN_GET_HASH(alg))
+ return (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) ?
+ PSA_KEY_USAGE_VERIFY_HASH |
+ PSA_KEY_USAGE_VERIFY_MESSAGE :
+ PSA_KEY_USAGE_SIGN_HASH |
+ PSA_KEY_USAGE_VERIFY_HASH |
+ PSA_KEY_USAGE_SIGN_MESSAGE |
+ PSA_KEY_USAGE_VERIFY_MESSAGE);
+ } else if (PSA_ALG_IS_SIGN_MESSAGE(alg))
+ return (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) ?
+ PSA_KEY_USAGE_VERIFY_MESSAGE :
+ PSA_KEY_USAGE_SIGN_MESSAGE |
+ PSA_KEY_USAGE_VERIFY_MESSAGE);
- return( PSA_KEY_TYPE_IS_PUBLIC_KEY( type ) ?
- PSA_KEY_USAGE_VERIFY_HASH :
- PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_VERIFY_HASH );
+ return (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) ?
+ PSA_KEY_USAGE_VERIFY_HASH :
+ PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_VERIFY_HASH);
+ } else if (PSA_ALG_IS_CIPHER(alg) || PSA_ALG_IS_AEAD(alg) ||
+ PSA_ALG_IS_ASYMMETRIC_ENCRYPTION(alg)) {
+ return (PSA_KEY_TYPE_IS_PUBLIC_KEY(type) ?
+ PSA_KEY_USAGE_ENCRYPT :
+ PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT);
+ } else if (PSA_ALG_IS_KEY_DERIVATION(alg) ||
+ PSA_ALG_IS_KEY_AGREEMENT(alg)) {
+ return PSA_KEY_USAGE_DERIVE;
+ } else {
+ return 0;
}
- else if( PSA_ALG_IS_CIPHER( alg ) || PSA_ALG_IS_AEAD( alg ) ||
- PSA_ALG_IS_ASYMMETRIC_ENCRYPTION( alg ) )
- {
- return( PSA_KEY_TYPE_IS_PUBLIC_KEY( type ) ?
- PSA_KEY_USAGE_ENCRYPT :
- PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT );
- }
- else if( PSA_ALG_IS_KEY_DERIVATION( alg ) ||
- PSA_ALG_IS_KEY_AGREEMENT( alg ) )
- {
- return PSA_KEY_USAGE_DERIVE ;
- }
- else
- {
- return 0 ;
- }
-
}
#endif /* MBEDTLS_PSA_CRYPTO_C */
diff --git a/tests/src/random.c b/tests/src/random.c
index d578985..10adc53 100644
--- a/tests/src/random.c
+++ b/tests/src/random.c
@@ -26,9 +26,9 @@
* for arc4random_buf() from <stdlib.h>
*/
#if defined(__NetBSD__)
-#define _NETBSD_SOURCE 1
+# define _NETBSD_SOURCE 1
#elif defined(__OpenBSD__)
-#define _BSD_SOURCE 1
+# define _BSD_SOURCE 1
#endif
#include <test/macros.h>
@@ -37,109 +37,102 @@
#include <mbedtls/entropy.h>
-int mbedtls_test_rnd_std_rand( void *rng_state,
- unsigned char *output,
- size_t len )
+int mbedtls_test_rnd_std_rand(void *rng_state,
+ unsigned char *output,
+ size_t len)
{
#if !defined(__OpenBSD__) && !defined(__NetBSD__)
size_t i;
- if( rng_state != NULL )
- rng_state = NULL;
-
- for( i = 0; i < len; ++i )
- output[i] = rand();
-#else
- if( rng_state != NULL )
+ if (rng_state != NULL)
rng_state = NULL;
- arc4random_buf( output, len );
+ for (i = 0; i < len; ++i)
+ output[i] = rand();
+#else
+ if (rng_state != NULL)
+ rng_state = NULL;
+
+ arc4random_buf(output, len);
#endif /* !OpenBSD && !NetBSD */
- return 0 ;
+ return 0;
}
-int mbedtls_test_rnd_zero_rand( void *rng_state,
- unsigned char *output,
- size_t len )
+int mbedtls_test_rnd_zero_rand(void *rng_state,
+ unsigned char *output,
+ size_t len)
{
- if( rng_state != NULL )
- rng_state = NULL;
+ if (rng_state != NULL)
+ rng_state = NULL;
- memset( output, 0, len );
+ memset(output, 0, len);
- return 0 ;
+ return 0;
}
-int mbedtls_test_rnd_buffer_rand( void *rng_state,
- unsigned char *output,
- size_t len )
+int mbedtls_test_rnd_buffer_rand(void *rng_state,
+ unsigned char *output,
+ size_t len)
{
- mbedtls_test_rnd_buf_info *info = (mbedtls_test_rnd_buf_info *) rng_state;
+ mbedtls_test_rnd_buf_info *info = (mbedtls_test_rnd_buf_info *)rng_state;
size_t use_len;
- if( rng_state == NULL )
- return mbedtls_test_rnd_std_rand( NULL, output, len ) ;
+ if (rng_state == NULL)
+ return mbedtls_test_rnd_std_rand(NULL, output, len);
use_len = len;
- if( len > info->length )
+ if (len > info->length)
use_len = info->length;
- if( use_len )
- {
- memcpy( output, info->buf, use_len );
+ if (use_len) {
+ memcpy(output, info->buf, use_len);
info->buf += use_len;
info->length -= use_len;
}
- if( len - use_len > 0 )
- {
- if( info->fallback_f_rng != NULL )
- {
- return( info->fallback_f_rng( info->fallback_p_rng,
- output + use_len,
- len - use_len ) );
- }
- else
- return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED ;
+ if (len - use_len > 0) {
+ if (info->fallback_f_rng != NULL) {
+ return (info->fallback_f_rng(info->fallback_p_rng, output + use_len,
+ len - use_len));
+ } else
+ return MBEDTLS_ERR_ENTROPY_SOURCE_FAILED;
}
- return 0 ;
+ return 0;
}
-int mbedtls_test_rnd_pseudo_rand( void *rng_state,
- unsigned char *output,
- size_t len )
+int mbedtls_test_rnd_pseudo_rand(void *rng_state,
+ unsigned char *output,
+ size_t len)
{
mbedtls_test_rnd_pseudo_info *info =
- (mbedtls_test_rnd_pseudo_info *) rng_state;
- uint32_t i, *k, sum, delta=0x9E3779B9;
+ (mbedtls_test_rnd_pseudo_info *)rng_state;
+ uint32_t i, *k, sum, delta = 0x9E3779B9;
unsigned char result[4], *out = output;
- if( rng_state == NULL )
- return mbedtls_test_rnd_std_rand( NULL, output, len ) ;
+ if (rng_state == NULL)
+ return mbedtls_test_rnd_std_rand(NULL, output, len);
k = info->key;
- while( len > 0 )
- {
- size_t use_len = ( len > 4 ) ? 4 : len;
+ while (len > 0) {
+ size_t use_len = (len > 4) ? 4 : len;
sum = 0;
- for( i = 0; i < 32; i++ )
- {
- info->v0 += ( ( ( info->v1 << 4 ) ^ ( info->v1 >> 5 ) )
- + info->v1 ) ^ ( sum + k[sum & 3] );
+ for (i = 0; i < 32; i++) {
+ info->v0 += (((info->v1 << 4) ^ (info->v1 >> 5)) + info->v1) ^
+ (sum + k[sum & 3]);
sum += delta;
- info->v1 += ( ( ( info->v0 << 4 ) ^ ( info->v0 >> 5 ) )
- + info->v0 ) ^ ( sum + k[( sum>>11 ) & 3] );
+ info->v1 += (((info->v0 << 4) ^ (info->v0 >> 5)) + info->v0) ^
+ (sum + k[(sum >> 11) & 3]);
}
- PUT_UINT32_BE( info->v0, result, 0 );
- memcpy( out, result, use_len );
+ PUT_UINT32_BE(info->v0, result, 0);
+ memcpy(out, result, use_len);
len -= use_len;
out += 4;
}
- return 0 ;
+ return 0;
}
diff --git a/tests/src/threading_helpers.c b/tests/src/threading_helpers.c
index f5a9564..32a4c6f 100644
--- a/tests/src/threading_helpers.c
+++ b/tests/src/threading_helpers.c
@@ -22,7 +22,7 @@
#if defined(MBEDTLS_TEST_MUTEX_USAGE)
-#include "mbedtls/threading.h"
+# include "mbedtls/threading.h"
/** Mutex usage verification framework.
*
@@ -82,12 +82,11 @@
MUTEX_LOCKED = 2, //!< Set by our lock
};
-typedef struct
-{
- void (*init)( mbedtls_threading_mutex_t * );
- void (*free)( mbedtls_threading_mutex_t * );
- int (*lock)( mbedtls_threading_mutex_t * );
- int (*unlock)( mbedtls_threading_mutex_t * );
+typedef struct {
+ void (*init)(mbedtls_threading_mutex_t *);
+ void (*free)(mbedtls_threading_mutex_t *);
+ int (*lock)(mbedtls_threading_mutex_t *);
+ int (*unlock)(mbedtls_threading_mutex_t *);
} mutex_functions_t;
static mutex_functions_t mutex_functions;
@@ -98,94 +97,92 @@
*/
static int live_mutexes;
-static void mbedtls_test_mutex_usage_error( mbedtls_threading_mutex_t *mutex,
- const char *msg )
+static void mbedtls_test_mutex_usage_error(mbedtls_threading_mutex_t *mutex,
+ const char *msg)
{
- (void) mutex;
- if( mbedtls_test_info.mutex_usage_error == NULL )
+ (void)mutex;
+ if (mbedtls_test_info.mutex_usage_error == NULL)
mbedtls_test_info.mutex_usage_error = msg;
- mbedtls_fprintf( stdout, "[mutex: %s] ", msg );
+ mbedtls_fprintf(stdout, "[mutex: %s] ", msg);
/* Don't mark the test as failed yet. This way, if the test fails later
* for a functional reason, the test framework will report the message
* and location for this functional reason. If the test passes,
* mbedtls_test_mutex_usage_check() will mark it as failed. */
}
-static void mbedtls_test_wrap_mutex_init( mbedtls_threading_mutex_t *mutex )
+static void mbedtls_test_wrap_mutex_init(mbedtls_threading_mutex_t *mutex)
{
- mutex_functions.init( mutex );
- if( mutex->is_valid )
+ mutex_functions.init(mutex);
+ if (mutex->is_valid)
++live_mutexes;
}
-static void mbedtls_test_wrap_mutex_free( mbedtls_threading_mutex_t *mutex )
+static void mbedtls_test_wrap_mutex_free(mbedtls_threading_mutex_t *mutex)
{
- switch( mutex->is_valid )
- {
+ switch (mutex->is_valid) {
case MUTEX_FREED:
- mbedtls_test_mutex_usage_error( mutex, "free without init or double free" );
+ mbedtls_test_mutex_usage_error(mutex,
+ "free without init or double free");
break;
case MUTEX_IDLE:
/* Do nothing. The underlying free function will reset is_valid
* to 0. */
break;
case MUTEX_LOCKED:
- mbedtls_test_mutex_usage_error( mutex, "free without unlock" );
+ mbedtls_test_mutex_usage_error(mutex, "free without unlock");
break;
default:
- mbedtls_test_mutex_usage_error( mutex, "corrupted state" );
+ mbedtls_test_mutex_usage_error(mutex, "corrupted state");
break;
}
- if( mutex->is_valid )
+ if (mutex->is_valid)
--live_mutexes;
- mutex_functions.free( mutex );
+ mutex_functions.free(mutex);
}
-static int mbedtls_test_wrap_mutex_lock( mbedtls_threading_mutex_t *mutex )
+static int mbedtls_test_wrap_mutex_lock(mbedtls_threading_mutex_t *mutex)
{
- int ret = mutex_functions.lock( mutex );
- switch( mutex->is_valid )
- {
+ int ret = mutex_functions.lock(mutex);
+ switch (mutex->is_valid) {
case MUTEX_FREED:
- mbedtls_test_mutex_usage_error( mutex, "lock without init" );
+ mbedtls_test_mutex_usage_error(mutex, "lock without init");
break;
case MUTEX_IDLE:
- if( ret == 0 )
+ if (ret == 0)
mutex->is_valid = 2;
break;
case MUTEX_LOCKED:
- mbedtls_test_mutex_usage_error( mutex, "double lock" );
+ mbedtls_test_mutex_usage_error(mutex, "double lock");
break;
default:
- mbedtls_test_mutex_usage_error( mutex, "corrupted state" );
+ mbedtls_test_mutex_usage_error(mutex, "corrupted state");
break;
}
- return ret ;
+ return ret;
}
-static int mbedtls_test_wrap_mutex_unlock( mbedtls_threading_mutex_t *mutex )
+static int mbedtls_test_wrap_mutex_unlock(mbedtls_threading_mutex_t *mutex)
{
- int ret = mutex_functions.unlock( mutex );
- switch( mutex->is_valid )
- {
+ int ret = mutex_functions.unlock(mutex);
+ switch (mutex->is_valid) {
case MUTEX_FREED:
- mbedtls_test_mutex_usage_error( mutex, "unlock without init" );
+ mbedtls_test_mutex_usage_error(mutex, "unlock without init");
break;
case MUTEX_IDLE:
- mbedtls_test_mutex_usage_error( mutex, "unlock without lock" );
+ mbedtls_test_mutex_usage_error(mutex, "unlock without lock");
break;
case MUTEX_LOCKED:
- if( ret == 0 )
+ if (ret == 0)
mutex->is_valid = MUTEX_IDLE;
break;
default:
- mbedtls_test_mutex_usage_error( mutex, "corrupted state" );
+ mbedtls_test_mutex_usage_error(mutex, "corrupted state");
break;
}
- return ret ;
+ return ret;
}
-void mbedtls_test_mutex_usage_init( void )
+void mbedtls_test_mutex_usage_init(void)
{
mutex_functions.init = mbedtls_mutex_init;
mutex_functions.free = mbedtls_mutex_free;
@@ -197,25 +194,23 @@
mbedtls_mutex_unlock = &mbedtls_test_wrap_mutex_unlock;
}
-void mbedtls_test_mutex_usage_check( void )
+void mbedtls_test_mutex_usage_check(void)
{
- if( live_mutexes != 0 )
- {
+ if (live_mutexes != 0) {
/* A positive number (more init than free) means that a mutex resource
* is leaking (on platforms where a mutex consumes more than the
* mbedtls_threading_mutex_t object itself). The rare case of a
* negative number means a missing init somewhere. */
- mbedtls_fprintf( stdout, "[mutex: %d leaked] ", live_mutexes );
+ mbedtls_fprintf(stdout, "[mutex: %d leaked] ", live_mutexes);
live_mutexes = 0;
- if( mbedtls_test_info.mutex_usage_error == NULL )
+ if (mbedtls_test_info.mutex_usage_error == NULL)
mbedtls_test_info.mutex_usage_error = "missing free";
}
- if( mbedtls_test_info.mutex_usage_error != NULL &&
- mbedtls_test_info.result != MBEDTLS_TEST_RESULT_FAILED )
- {
+ if (mbedtls_test_info.mutex_usage_error != NULL &&
+ mbedtls_test_info.result != MBEDTLS_TEST_RESULT_FAILED) {
/* Functionally, the test passed. But there was a mutex usage error,
* so mark the test as failed after all. */
- mbedtls_test_fail( "Mutex usage error", __LINE__, __FILE__ );
+ mbedtls_test_fail("Mutex usage error", __LINE__, __FILE__);
}
mbedtls_test_info.mutex_usage_error = NULL;
}