/* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #ifndef __TEST_CERTS_H__ #define __TEST_CERTS_H__ #if defined(CONFIG_NET_SOCKETS_OFFLOAD) /* By default only certificates in DER format are supported. If you want to use * certificate in PEM format, you can enable support for it in Kconfig. */ #if defined(CONFIG_TLS_CREDENTIAL_FILENAMES) static const unsigned char ca_certificate[] = "ca_cert.der"; #else static const unsigned char ca_certificate[] = { #include "ca_cert.der.inc" }; #endif #else #include #if defined(MBEDTLS_X509_CRT_PARSE_C) /* This byte array can be generated by * "cat ca.crt | sed -e '1d;$d' | base64 -d |xxd -i" */ static const unsigned char ca_certificate[] = { 0x30, 0x82, 0x02, 0xfb, 0x30, 0x82, 0x01, 0xe3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0xee, 0x10, 0x1f, 0xc1, 0xf2, 0x30, 0xe9, 0x11, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x14, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x37, 0x30, 0x36, 0x32, 0x36, 0x31, 0x30, 0x35, 0x36, 0x31, 0x30, 0x5a, 0x17, 0x0d, 0x34, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x30, 0x35, 0x36, 0x31, 0x30, 0x5a, 0x30, 0x14, 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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0x7a, 0x97, 0x09, 0xb5, 0x2f, 0x20, 0x8e, 0xed, 0xbc, 0x98, 0x6f, 0x95, 0xd5, 0x5b, 0x3d, 0x26, 0x19, 0x26, 0x14, 0x39, 0x82, 0xa8, 0xa8, 0x42, 0x46, 0xab, 0x59, 0x93, 0x47, 0x83, 0xf7, 0x79, 0xbf, 0x73, 0xb5, 0x5d, 0x5d, 0x78, 0xfe, 0x62, 0xac, 0xed, 0xb7, 0x1e, 0x4a, 0xad, 0xc3, 0x99, 0x39, 0x7d, 0x3e, 0x30, 0x21, 0x26, 0x1d, 0x66, 0xdb, 0x0d, 0xf3, 0xba, 0x87, 0x46, 0xf0, 0x04, 0xfc, 0xc3, 0xbe, 0x84, 0x85, 0x3c, 0x01, 0xef, 0xe0, 0x68, 0x65, 0xee, }; #endif /* MBEDTLS_X509_CRT_PARSE_C */ #if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) /* Avoid leading zero in psk because there's a potential issue of mosquitto * that leading zero of psk will be skipped and it leads to TLS handshake * failure */ const unsigned char client_psk[] = { 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; const char client_psk_id[] = "Client_identity"; #endif #endif /* CONFIG_NET_SOCKETS_OFFLOAD */ #endif