summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-07-30 02:48:11 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-08-03 07:55:02 +0200
commit781e864706819652129130f5f2ee5d2aef680540 (patch)
tree394baf60c43526a1135631830392466fee6c231e /devel
parente6134b8c15e5c176f8c77a8e7fc0e2b065c204a5 (diff)
downloadgnutls-781e864706819652129130f5f2ee5d2aef680540.tar.gz
fuzz: added PSK server fuzzer
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/fuzz/Makefile4
-rw-r--r--devel/fuzz/certs.h255
-rw-r--r--devel/fuzz/gnutls_psk_server.in/trace-client-dhe-pskbin0 -> 529 bytes
-rw-r--r--devel/fuzz/gnutls_psk_server.in/trace-client-ecdhe-pskbin0 -> 309 bytes
-rw-r--r--devel/fuzz/gnutls_psk_server.in/trace-client-pskbin0 -> 271 bytes
-rw-r--r--devel/fuzz/gnutls_psk_server.in/trace-client-rsa-pskbin0 -> 573 bytes
-rw-r--r--devel/fuzz/gnutls_psk_server_fuzzer.cc169
-rw-r--r--devel/fuzz/gnutls_server_fuzzer.cc228
8 files changed, 427 insertions, 229 deletions
diff --git a/devel/fuzz/Makefile b/devel/fuzz/Makefile
index a1950ab059..07704bee0b 100644
--- a/devel/fuzz/Makefile
+++ b/devel/fuzz/Makefile
@@ -25,7 +25,7 @@ all: gnutls_pkcs7_parser_fuzzer gnutls_client_fuzzer gnutls_dn_parser_fuzzer \
gnutls_private_key_parser_fuzzer gnutls_server_fuzzer gnutls_x509_parser_fuzzer \
gnutls_reverse_idna_parser_fuzzer gnutls_idna_parser_fuzzer gnutls_ocsp_resp_parser_fuzzer \
gnutls_ocsp_req_parser_fuzzer gnutls_pkcs12_key_parser_fuzzer gnutls_base64_decoder_fuzzer \
- gnutls_base64_encoder_fuzzer gnutls_psk_client_fuzzer
+ gnutls_base64_encoder_fuzzer gnutls_psk_client_fuzzer gnutls_psk_server_fuzzer
%: %.cc
$(CC) $(CFLAGS) main.c $^ $(COMMON) -o $@
@@ -36,7 +36,7 @@ clean:
gnutls_private_key_parser_fuzzer gnutls_server_fuzzer gnutls_x509_parser_fuzzer \
gnutls_idna_parser_fuzzer gnutls_reverse_idna_parser_fuzzer gnutls_ocsp_resp_parser_fuzzer \
gnutls_ocsp_req_parser_fuzzer gnutls_base64_decoder_fuzzer \
- gnutls_base64_encoder_fuzzer gnutls_psk_client_fuzzer
+ gnutls_base64_encoder_fuzzer gnutls_psk_client_fuzzer gnutls_psk_server_fuzzer
update:
@git clone --depth=1 https://github.com/openssl/openssl openssl.tmp
diff --git a/devel/fuzz/certs.h b/devel/fuzz/certs.h
new file mode 100644
index 0000000000..754c130b1c
--- /dev/null
+++ b/devel/fuzz/certs.h
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2017 Nikos Mavrogiannopoulos
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef CERTS_H
+# define CERTS_H
+
+static const uint8_t kRSACertificateDER[] = {
+ 0x30, 0x82, 0x02, 0xff, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01,
+ 0x02, 0x02, 0x11, 0x00, 0xb1, 0x84, 0xee, 0x34, 0x99, 0x98, 0x76, 0xfb,
+ 0x6f, 0xb2, 0x15, 0xc8, 0x47, 0x79, 0x05, 0x9b, 0x30, 0x0d, 0x06, 0x09,
+ 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30,
+ 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07,
+ 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f, 0x30, 0x1e, 0x17, 0x0d, 0x31,
+ 0x35, 0x31, 0x31, 0x30, 0x37, 0x30, 0x30, 0x32, 0x34, 0x35, 0x36, 0x5a,
+ 0x17, 0x0d, 0x31, 0x36, 0x31, 0x31, 0x30, 0x36, 0x30, 0x30, 0x32, 0x34,
+ 0x35, 0x36, 0x5a, 0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55,
+ 0x04, 0x0a, 0x13, 0x07, 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f, 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, 0xce, 0x47, 0xcb, 0x11,
+ 0xbb, 0xd2, 0x9d, 0x8e, 0x9e, 0xd2, 0x1e, 0x14, 0xaf, 0xc7, 0xea, 0xb6,
+ 0xc9, 0x38, 0x2a, 0x6f, 0xb3, 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, 0x1b, 0x78, 0xc7, 0xcf, 0xc1, 0x77, 0xd0, 0xfb, 0xa9,
+ 0xfb, 0xc9, 0x66, 0x5a, 0xc5, 0x9b, 0x31, 0x41, 0x67, 0x01, 0xbe, 0x33,
+ 0x10, 0xba, 0x05, 0x58, 0xed, 0x76, 0x53, 0xde, 0x5d, 0xc1, 0xe8, 0xbb,
+ 0x9f, 0xf1, 0xcd, 0xfb, 0xdf, 0x64, 0x7f, 0xd7, 0x18, 0xab, 0x0f, 0x94,
+ 0x28, 0x95, 0x4a, 0xcc, 0x6a, 0xa9, 0x50, 0xc7, 0x05, 0x47, 0x10, 0x41,
+ 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x0e, 0x06,
+ 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x05,
+ 0xa0, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a,
+ 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x0c,
+ 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00,
+ 0x30, 0x19, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x12, 0x30, 0x10, 0x82,
+ 0x0e, 0x66, 0x75, 0x7a, 0x7a, 0x2e, 0x62, 0x6f, 0x72, 0x69, 0x6e, 0x67,
+ 0x73, 0x73, 0x6c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
+ 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x92,
+ 0xde, 0xef, 0x96, 0x06, 0x7b, 0xff, 0x71, 0x7d, 0x4e, 0xa0, 0x7d, 0xae,
+ 0xb8, 0x22, 0xb4, 0x2c, 0xf7, 0x96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,
+ 0xb2, 0xc6, 0xb2, 0x0a, 0x2a, 0x7c, 0x6d, 0x6a, 0x40, 0xfc, 0xf5, 0x50,
+ 0x98, 0x46, 0x89, 0x82, 0x40,
+};
+
+static const uint8_t kECDSACertificateDER[] = {
+ 0x30, 0x82, 0x02, 0xA6, 0x30, 0x82, 0x01, 0x5E, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x53,
+ 0x66, 0x2B, 0x39, 0x11, 0xBE, 0x18, 0xCB, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
+ 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04,
+ 0x03, 0x13, 0x0E, 0x47, 0x6E, 0x75, 0x54, 0x4C, 0x53, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43,
+ 0x41, 0x30, 0x22, 0x18, 0x0F, 0x32, 0x30, 0x31, 0x34, 0x30, 0x35, 0x30, 0x34, 0x31, 0x31, 0x35,
+ 0x37, 0x34, 0x36, 0x5A, 0x18, 0x0F, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33,
+ 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x14, 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, 0x4C, 0x54, 0x46, 0xB0, 0x82, 0x30, 0x2F, 0x08, 0x16, 0xB7,
+ 0x9F, 0x23, 0xFF, 0xCF, 0xBA,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,
+ 0x25, 0x2C, 0x0B, 0xA9, 0xEC, 0x0C, 0x98, 0x4A, 0x3A, 0x01, 0x38, 0xB6, 0x10, 0x70, 0x4E, 0x24,
+ 0x5B, 0xAB, 0xB7, 0xD0, 0xB2, 0xC3, 0x99, 0xAB, 0xA0, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE,
+ 0x3D, 0x03, 0x01, 0x07, 0xA1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x4C, 0x54, 0x46, 0xB0, 0x82, 0x30,
+ 0x2F, 0x08, 0x16, 0xB7, 0x9F, 0x23, 0xFF, 0xCF, 0xBA, 0x05, 0x0D, 0x8B, 0x6D, 0x18, 0x58, 0xAC,
+ 0x46, 0xB9, 0xD0, 0x9E, 0xAB, 0x72, 0x76, 0xF7, 0xC8, 0x0B, 0x3B, 0xD7, 0x6F, 0x6D, 0xC4, 0x97,
+ 0xFB, 0x0D, 0x88, 0x33, 0xBD, 0x17, 0xE2, 0xFE, 0x43, 0x8B, 0x48, 0x99, 0x60, 0x24, 0x57, 0x9C,
+ 0xB7, 0x25, 0x6E, 0x71, 0x4A, 0x3F, 0x03, 0x64, 0xDC, 0xB1
+};
+
+#endif
diff --git a/devel/fuzz/gnutls_psk_server.in/trace-client-dhe-psk b/devel/fuzz/gnutls_psk_server.in/trace-client-dhe-psk
new file mode 100644
index 0000000000..8c665c3df1
--- /dev/null
+++ b/devel/fuzz/gnutls_psk_server.in/trace-client-dhe-psk
Binary files differ
diff --git a/devel/fuzz/gnutls_psk_server.in/trace-client-ecdhe-psk b/devel/fuzz/gnutls_psk_server.in/trace-client-ecdhe-psk
new file mode 100644
index 0000000000..6537cab21f
--- /dev/null
+++ b/devel/fuzz/gnutls_psk_server.in/trace-client-ecdhe-psk
Binary files differ
diff --git a/devel/fuzz/gnutls_psk_server.in/trace-client-psk b/devel/fuzz/gnutls_psk_server.in/trace-client-psk
new file mode 100644
index 0000000000..d38ca40844
--- /dev/null
+++ b/devel/fuzz/gnutls_psk_server.in/trace-client-psk
Binary files differ
diff --git a/devel/fuzz/gnutls_psk_server.in/trace-client-rsa-psk b/devel/fuzz/gnutls_psk_server.in/trace-client-rsa-psk
new file mode 100644
index 0000000000..b466332508
--- /dev/null
+++ b/devel/fuzz/gnutls_psk_server.in/trace-client-rsa-psk
Binary files differ
diff --git a/devel/fuzz/gnutls_psk_server_fuzzer.cc b/devel/fuzz/gnutls_psk_server_fuzzer.cc
new file mode 100644
index 0000000000..a9708261af
--- /dev/null
+++ b/devel/fuzz/gnutls_psk_server_fuzzer.cc
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2017 Nikos Mavrogiannopoulos
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <assert.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <gnutls/gnutls.h>
+
+#include "certs.h"
+
+struct mem_st {
+ const uint8_t *data;
+ size_t size;
+};
+
+#define MIN(x,y) ((x)<(y)?(x):(y))
+static ssize_t
+server_push(gnutls_transport_ptr_t tr, const void *data, size_t len)
+{
+ return len;
+}
+
+static ssize_t server_pull(gnutls_transport_ptr_t tr, void *data, size_t len)
+{
+ struct mem_st *p = (struct mem_st*)tr;
+
+ if (p->size == 0) {
+ return 0;
+ }
+
+ len = MIN(len, p->size);
+ memcpy(data, p->data, len);
+
+ p->size -= len;
+ p->data += len;
+
+ return len;
+}
+
+int server_pull_timeout_func(gnutls_transport_ptr_t tr, unsigned int ms)
+{
+ struct mem_st *p = (struct mem_st*)tr;
+
+ if (p->size > 0)
+ return 1; /* available data */
+ else
+ return 0; /* timeout */
+}
+
+static int
+psk_cb(gnutls_session_t session, const char *username,
+ gnutls_datum_t * key)
+{
+ key->data = (unsigned char*)gnutls_malloc(16);
+ assert(key->data != NULL);
+
+ memcpy(key->data,
+ "\x8a\x77\x59\xb3\xf2\x69\x83\xc4\x53\xe4\x48\x06\x0b\xde\x89\x81",
+ 16);
+ key->size = 16;
+
+ return 0;
+}
+
+#ifdef __cplusplus
+extern "C"
+#endif
+int LLVMFuzzerTestOneInput(const uint8_t * data, size_t size)
+{
+ int res;
+ gnutls_datum_t rsa_cert, rsa_key;
+ gnutls_datum_t ecdsa_cert, ecdsa_key;
+ gnutls_session_t session;
+ gnutls_certificate_credentials_t xcred;
+ gnutls_psk_server_credentials_t pcred;
+ struct mem_st memdata;
+
+ res = gnutls_init(&session, GNUTLS_SERVER);
+ assert(res >= 0);
+
+ res = gnutls_certificate_allocate_credentials(&xcred);
+ assert(res >= 0);
+
+ res = gnutls_psk_allocate_server_credentials(&pcred);
+ assert(res >= 0);
+
+ gnutls_psk_set_server_credentials_function(pcred, psk_cb);
+ gnutls_psk_set_server_known_dh_params(pcred, GNUTLS_SEC_PARAM_MEDIUM);
+
+ rsa_cert.data = (unsigned char *)kRSACertificateDER;
+ rsa_cert.size = sizeof(kRSACertificateDER);
+ rsa_key.data = (unsigned char *)kRSAPrivateKeyDER;
+ rsa_key.size = sizeof(kRSAPrivateKeyDER);
+
+ ecdsa_cert.data = (unsigned char *)kECDSACertificateDER;
+ ecdsa_cert.size = sizeof(kECDSACertificateDER);
+ ecdsa_key.data = (unsigned char *)kECDSAPrivateKeyDER;
+ ecdsa_key.size = sizeof(kECDSAPrivateKeyDER);
+
+ res =
+ gnutls_certificate_set_x509_key_mem(xcred, &rsa_cert, &rsa_key,
+ GNUTLS_X509_FMT_DER);
+ assert(res >= 0);
+
+ res =
+ gnutls_certificate_set_x509_key_mem(xcred, &ecdsa_cert, &ecdsa_key,
+ GNUTLS_X509_FMT_DER);
+ assert(res >= 0);
+
+ gnutls_certificate_set_known_dh_params(xcred, GNUTLS_SEC_PARAM_MEDIUM);
+
+ res = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, xcred);
+ assert(res >= 0);
+
+ res = gnutls_credentials_set(session, GNUTLS_CRD_PSK, pcred);
+ assert(res >= 0);
+
+ res = gnutls_priority_set_direct(session, "NORMAL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK:+RSA-PSK", NULL);
+ assert(res >= 0);
+
+ memdata.data = data;
+ memdata.size = size;
+
+ gnutls_transport_set_push_function(session, server_push);
+ gnutls_transport_set_pull_function(session, server_pull);
+ gnutls_transport_set_pull_timeout_function(session, server_pull_timeout_func);
+ gnutls_transport_set_ptr(session, &memdata);
+
+ do {
+ res = gnutls_handshake(session);
+ } while (res < 0 && gnutls_error_is_fatal(res) == 0);
+ if (res >= 0) {
+ while (true) {
+ char buf[16384];
+ res = gnutls_record_recv(session, buf, sizeof(buf));
+ if (res <= 0) {
+ break;
+ }
+ }
+ }
+
+ gnutls_deinit(session);
+ gnutls_certificate_free_credentials(xcred);
+ gnutls_psk_free_server_credentials(pcred);
+ return 0;
+}
diff --git a/devel/fuzz/gnutls_server_fuzzer.cc b/devel/fuzz/gnutls_server_fuzzer.cc
index a9804f32dc..595548e739 100644
--- a/devel/fuzz/gnutls_server_fuzzer.cc
+++ b/devel/fuzz/gnutls_server_fuzzer.cc
@@ -24,233 +24,7 @@
#include <gnutls/gnutls.h>
-static const uint8_t kRSACertificateDER[] = {
- 0x30, 0x82, 0x02, 0xff, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01,
- 0x02, 0x02, 0x11, 0x00, 0xb1, 0x84, 0xee, 0x34, 0x99, 0x98, 0x76, 0xfb,
- 0x6f, 0xb2, 0x15, 0xc8, 0x47, 0x79, 0x05, 0x9b, 0x30, 0x0d, 0x06, 0x09,
- 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30,
- 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07,
- 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f, 0x30, 0x1e, 0x17, 0x0d, 0x31,
- 0x35, 0x31, 0x31, 0x30, 0x37, 0x30, 0x30, 0x32, 0x34, 0x35, 0x36, 0x5a,
- 0x17, 0x0d, 0x31, 0x36, 0x31, 0x31, 0x30, 0x36, 0x30, 0x30, 0x32, 0x34,
- 0x35, 0x36, 0x5a, 0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55,
- 0x04, 0x0a, 0x13, 0x07, 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f, 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, 0xce, 0x47, 0xcb, 0x11,
- 0xbb, 0xd2, 0x9d, 0x8e, 0x9e, 0xd2, 0x1e, 0x14, 0xaf, 0xc7, 0xea, 0xb6,
- 0xc9, 0x38, 0x2a, 0x6f, 0xb3, 0x7e, 0xfb, 0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1, 0x77, 0xd0, 0xfb, 0xa9,
- 0xfb, 0xc9, 0x66, 0x5a, 0xc5, 0x9b, 0x31, 0x41, 0x67, 0x01, 0xbe, 0x33,
- 0x10, 0xba, 0x05, 0x58, 0xed, 0x76, 0x53, 0xde, 0x5d, 0xc1, 0xe8, 0xbb,
- 0x9f, 0xf1, 0xcd, 0xfb, 0xdf, 0x64, 0x7f, 0xd7, 0x18, 0xab, 0x0f, 0x94,
- 0x28, 0x95, 0x4a, 0xcc, 0x6a, 0xa9, 0x50, 0xc7, 0x05, 0x47, 0x10, 0x41,
- 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x0e, 0x06,
- 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x05,
- 0xa0, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a,
- 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x0c,
- 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00,
- 0x30, 0x19, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x12, 0x30, 0x10, 0x82,
- 0x0e, 0x66, 0x75, 0x7a, 0x7a, 0x2e, 0x62, 0x6f, 0x72, 0x69, 0x6e, 0x67,
- 0x73, 0x73, 0x6c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
- 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x92,
- 0xde, 0xef, 0x96, 0x06, 0x7b, 0xff, 0x71, 0x7d, 0x4e, 0xa0, 0x7d, 0xae,
- 0xb8, 0x22, 0xb4, 0x2c, 0xf7, 0x96, 0x9c, 0x37, 0x1d, 0x8f, 0xe7, 0xd9,
- 0x47,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a9, 0xae, 0xe8, 0xfc, 0xbe, 0xa5, 0x76, 0x94, 0xd7, 0x64, 0x22,
- 0x38, 0x98, 0x17, 0xa4, 0x3a, 0xa7, 0x59, 0x9f, 0x1d, 0x3b, 0x75, 0x90,
- 0x1a, 0x81, 0xef, 0x19, 0xfb, 0x2b, 0xb7, 0xa7, 0x64, 0x61, 0x22, 0xa4,
- 0x6f, 0x7b, 0xfa, 0x58, 0xbb, 0x8c, 0x4e, 0x77, 0x67, 0xd0, 0x5d, 0x58,
- 0x76, 0x8a, 0xbb,
-};
-
-static const uint8_t kRSAPrivateKeyDER[] = {
- 0x30, 0x82, 0x04, 0xa5, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
- 0xce, 0x47, 0xcb, 0x11, 0xbb, 0xd2, 0x9d, 0x8e, 0x9e, 0xd2, 0x1e, 0x14,
- 0xaf, 0xc7, 0xea, 0xb6, 0xc9, 0x38, 0x2a, 0x6f, 0xb3, 0x7e, 0xfb, 0xbc,
- 0xfc, 0x59, 0x42, 0xb9, 0x56, 0xf0, 0x4c, 0x3f, 0xf7, 0x31, 0x84, 0xbe,
- 0xac, 0x03, 0x9e, 0x71, 0x91, 0x85, 0xd8, 0x32, 0xbd, 0x00, 0xea, 0xac,
- 0x65, 0xf6, 0x03, 0xc8, 0x0f, 0x8b, 0xfd, 0x6e, 0x58, 0x88, 0x04, 0x41,
- 0x92, 0x74, 0xa6, 0x57, 0x2e, 0x8e, 0x88, 0xd5, 0x3d, 0xda, 0x14, 0x3e,
- 0x63, 0x88, 0x22, 0xe3, 0x53, 0xe9, 0xba, 0x39, 0x09, 0xac, 0xfb, 0xd0,
- 0x4c, 0xf2, 0x3c, 0x20, 0xd6, 0x97, 0xe6, 0xed, 0xf1, 0x62, 0x1e, 0xe5,
- 0xc9, 0x48, 0xa0, 0xca, 0x2e, 0x3c, 0x14, 0x5a, 0x82, 0xd4, 0xed, 0xb1,
- 0xe3, 0x43, 0xc1, 0x2a, 0x59,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4, 0x0e, 0x77, 0xfa, 0xa9, 0xdd, 0xdc, 0xb9,
- 0x88, 0x19, 0x23, 0x70, 0xc7, 0xe1, 0x60, 0xaf, 0x8c, 0x73, 0x04, 0xf7,
- 0x71, 0x17, 0x81, 0x36, 0x75, 0xbb, 0x97, 0xd7, 0x75, 0xb6, 0x8e, 0xbc,
- 0xac, 0x9c, 0x6a, 0x9b, 0x24, 0x89, 0x02, 0x81, 0x80, 0x5a, 0x2b, 0xc7,
- 0x6b, 0x8c, 0x65, 0xdb, 0x04, 0x73, 0xab, 0x25, 0xe1, 0x5b, 0xbc, 0x3c,
- 0xcf, 0x5a, 0x3c, 0x04, 0xae, 0x97, 0x2e, 0xfd, 0xa4, 0x97, 0x1f, 0x05,
- 0x17, 0x27, 0xac, 0x7c, 0x30, 0x85, 0xb4, 0x82, 0x3f, 0x5b, 0xb7, 0x94,
- 0x3b, 0x7f, 0x6c, 0x0c, 0xc7, 0x16, 0xc6, 0xa0, 0xbd, 0x80, 0xb0, 0x81,
- 0xde, 0xa0, 0x23, 0xa6, 0xf6, 0x75, 0x33, 0x51, 0x35, 0xa2, 0x75, 0x55,
- 0x70, 0x4d, 0x42, 0xbb, 0xcf, 0x54, 0xe4, 0xdb, 0x2d, 0x88, 0xa0, 0x7a,
- 0xf2, 0x17, 0xa7, 0xdd, 0x13, 0x44, 0x9f, 0x5f, 0x6b, 0x2c, 0x42, 0x42,
- 0x8b, 0x13, 0x4d, 0xf9, 0x5b, 0xf8, 0x33, 0x42, 0xd9, 0x9e, 0x50, 0x1c,
- 0x7c, 0xbc, 0xfa, 0x62, 0x85, 0x0b, 0xcf, 0x99, 0xda, 0x9e, 0x04, 0x90,
- 0xb2, 0xc6, 0xb2, 0x0a, 0x2a, 0x7c, 0x6d, 0x6a, 0x40, 0xfc, 0xf5, 0x50,
- 0x98, 0x46, 0x89, 0x82, 0x40,
-};
-
-static const uint8_t kECDSACertificateDER[] = {
- 0x30, 0x82, 0x02, 0xA6, 0x30, 0x82, 0x01, 0x5E, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x53,
- 0x66, 0x2B, 0x39, 0x11, 0xBE, 0x18, 0xCB, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
- 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x19, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04,
- 0x03, 0x13, 0x0E, 0x47, 0x6E, 0x75, 0x54, 0x4C, 0x53, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43,
- 0x41, 0x30, 0x22, 0x18, 0x0F, 0x32, 0x30, 0x31, 0x34, 0x30, 0x35, 0x30, 0x34, 0x31, 0x31, 0x35,
- 0x37, 0x34, 0x36, 0x5A, 0x18, 0x0F, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33,
- 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x14, 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, 0x4C, 0x54, 0x46, 0xB0, 0x82, 0x30, 0x2F, 0x08, 0x16, 0xB7,
- 0x9F, 0x23, 0xFF, 0xCF, 0xBA, 0x05, 0x0D, 0x8B, 0x6D, 0x18, 0x58, 0xAC, 0x46, 0xB9, 0xD0, 0x9E,
- 0xAB, 0x72, 0x76, 0xF7, 0xC8, 0x0B, 0x3B, 0xD7, 0x6F, 0x6D, 0xC4, 0x97, 0xFB, 0x0D, 0x88, 0x33,
- 0xBD, 0x17, 0xE2, 0xFE, 0x43, 0x8B, 0x48, 0x99, 0x60, 0x24, 0x57, 0x9C, 0xB7, 0x25, 0x6E, 0x71,
- 0x4A, 0x3F, 0x03, 0x64, 0xDC, 0xB1, 0xA3, 0x81, 0x8D, 0x30, 0x81, 0x8A, 0x30, 0x0C, 0x06, 0x03,
- 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x02, 0x30, 0x00, 0x30, 0x14, 0x06, 0x03, 0x55, 0x1D,
- 0x11, 0x04, 0x0D, 0x30, 0x0B, 0x82, 0x09, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x68, 0x6F, 0x73, 0x74,
- 0x30, 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C, 0x30, 0x0A, 0x06, 0x08, 0x2B, 0x06, 0x01,
- 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04,
- 0x05, 0x03, 0x03, 0x07, 0x80, 0x00, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04,
- 0x14, 0xBE, 0xF6, 0x00, 0xC6, 0x24, 0x6B, 0x60, 0xEA, 0xB5, 0xF8, 0x13, 0xC9, 0xA5, 0xD5, 0xE0,
- 0xC9, 0x29, 0xD5, 0xD7, 0x33, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16,
- 0x80, 0x14, 0x4D, 0x56, 0xB7, 0x6A, 0x00, 0x58, 0xF1, 0x67, 0x92, 0xF4, 0xA6, 0x75, 0x55, 0x1B,
- 0x8E, 0x53, 0x01, 0x03, 0xEF, 0xCF, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
- 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03, 0x82, 0x01, 0x31, 0x00, 0x63, 0xCD, 0xAF, 0xA6,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, 0xA1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x4C, 0x54, 0x46, 0xB0, 0x82, 0x30,
- 0x2F, 0x08, 0x16, 0xB7, 0x9F, 0x23, 0xFF, 0xCF, 0xBA, 0x05, 0x0D, 0x8B, 0x6D, 0x18, 0x58, 0xAC,
- 0x46, 0xB9, 0xD0, 0x9E, 0xAB, 0x72, 0x76, 0xF7, 0xC8, 0x0B, 0x3B, 0xD7, 0x6F, 0x6D, 0xC4, 0x97,
- 0xFB, 0x0D, 0x88, 0x33, 0xBD, 0x17, 0xE2, 0xFE, 0x43, 0x8B, 0x48, 0x99, 0x60, 0x24, 0x57, 0x9C,
- 0xB7, 0x25, 0x6E, 0x71, 0x4A, 0x3F, 0x03, 0x64, 0xDC, 0xB1
-};
+#include "certs.h"
struct mem_st {
const uint8_t *data;