]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/mbedtls_config.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Demo / FreeRTOS_IoT_Libraries / mqtt / common / mbedtls_config.h
diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/mbedtls_config.h b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/common/mbedtls_config.h
new file mode 100644 (file)
index 0000000..0f2861a
--- /dev/null
@@ -0,0 +1,126 @@
+/*\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/* This file configures mbed TLS for FreeRTOS. */\r
+\r
+#ifndef MBEDTLS_CONFIG_H_\r
+#define MBEDTLS_CONFIG_H_\r
+\r
+/* FreeRTOS include. */\r
+#include "FreeRTOS.h"\r
+\r
+/* Generate errors if deprecated functions are used. */\r
+#define MBEDTLS_DEPRECATED_REMOVED\r
+\r
+/* Place AES tables in ROM. */\r
+#define MBEDTLS_AES_ROM_TABLES\r
+\r
+/* Enable the following cipher modes. */\r
+#define MBEDTLS_CIPHER_MODE_CBC\r
+#define MBEDTLS_CIPHER_MODE_CFB\r
+#define MBEDTLS_CIPHER_MODE_CTR\r
+\r
+/* Enable the following cipher padding modes. */\r
+#define MBEDTLS_CIPHER_PADDING_PKCS7\r
+#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS\r
+#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN\r
+#define MBEDTLS_CIPHER_PADDING_ZEROS\r
+\r
+/* Cipher suite configuration. */\r
+#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES\r
+#define MBEDTLS_ECP_DP_SECP256R1_ENABLED\r
+#define MBEDTLS_ECP_NIST_OPTIM\r
+#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED\r
+#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED\r
+\r
+/* Enable all SSL alert messages. */\r
+#define MBEDTLS_SSL_ALL_ALERT_MESSAGES\r
+\r
+/* Enable the following SSL features. */\r
+#define MBEDTLS_SSL_ENCRYPT_THEN_MAC\r
+#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET\r
+#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH\r
+#define MBEDTLS_SSL_PROTO_TLS1_2\r
+#define MBEDTLS_SSL_ALPN\r
+#define MBEDTLS_SSL_SERVER_NAME_INDICATION\r
+\r
+/* Check certificate key usage. */\r
+#define MBEDTLS_X509_CHECK_KEY_USAGE\r
+#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE\r
+\r
+/* Disable platform entropy functions. */\r
+#define MBEDTLS_NO_PLATFORM_ENTROPY\r
+\r
+/* Enable the following mbed TLS features. */\r
+#define MBEDTLS_AES_C\r
+#define MBEDTLS_ASN1_PARSE_C\r
+#define MBEDTLS_ASN1_WRITE_C\r
+#define MBEDTLS_BASE64_C\r
+#define MBEDTLS_BIGNUM_C\r
+#define MBEDTLS_CIPHER_C\r
+#define MBEDTLS_CTR_DRBG_C\r
+#define MBEDTLS_ECDH_C\r
+#define MBEDTLS_ECDSA_C\r
+#define MBEDTLS_ECP_C\r
+#define MBEDTLS_ENTROPY_C\r
+#define MBEDTLS_GCM_C\r
+#define MBEDTLS_MD_C\r
+#define MBEDTLS_OID_C\r
+#define MBEDTLS_PEM_PARSE_C\r
+#define MBEDTLS_PK_C\r
+#define MBEDTLS_PK_PARSE_C\r
+#define MBEDTLS_PKCS1_V15\r
+#define MBEDTLS_PLATFORM_C\r
+#define MBEDTLS_RSA_C\r
+#define MBEDTLS_SHA1_C\r
+#define MBEDTLS_SHA256_C\r
+#define MBEDTLS_SSL_CLI_C\r
+#define MBEDTLS_SSL_TLS_C\r
+#define MBEDTLS_THREADING_ALT\r
+#define MBEDTLS_THREADING_C\r
+#define MBEDTLS_X509_USE_C\r
+#define MBEDTLS_X509_CRT_PARSE_C\r
+\r
+/* Set the memory allocation functions on FreeRTOS. */\r
+void * mbedtls_platform_calloc( size_t nmemb,\r
+                                size_t size );\r
+void mbedtls_platform_free( void * ptr );\r
+#define MBEDTLS_PLATFORM_MEMORY\r
+#define MBEDTLS_PLATFORM_CALLOC_MACRO    mbedtls_platform_calloc\r
+#define MBEDTLS_PLATFORM_FREE_MACRO      mbedtls_platform_free\r
+\r
+/* The network send and receive functions on FreeRTOS. */\r
+int mbedtls_platform_send( void * ctx,\r
+                           const unsigned char * buf,\r
+                           size_t len );\r
+int mbedtls_platform_recv( void * ctx,\r
+                           unsigned char * buf,\r
+                           size_t len );\r
+\r
+/* The entropy poll function. */\r
+int mbedtls_platform_entropy_poll( void * data,\r
+                                   unsigned char * output,\r
+                                   size_t len,\r
+                                   size_t * olen );\r
+\r
+#include "mbedtls/check_config.h"\r
+\r
+#endif /* ifndef MBEDTLS_CONFIG_H_ */\r