blob: 3e8f15310dc5dee413af2a7ee51cf5a7a0d554a7 [file] [log] [blame]
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +02001/*
2 * Minimal configuration for TLS NSA Suite B Profile (RFC 6460)
3 *
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +02004 * Distinguishing features:
5 * - no RSA or classic DH, fully based on ECC
6 * - optimized for low RAM usage
7 *
8 * Possible improvements:
9 * - if 128-bit security is enough, disable secp384r1 and SHA-512
10 * - use embedded certs in DER format and disable PEM_PARSE_C and BASE64_C
11 *
Manuel Pégourié-Gonnard0bc1f232014-04-30 11:53:50 +020012 * See README.txt for usage instructions.
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020013 */
14
Manuel Pégourié-Gonnard0bc1f232014-04-30 11:53:50 +020015#ifndef POLARSSL_CONFIG_H
16#define POLARSSL_CONFIG_H
17
18/* System support */
19#define POLARSSL_HAVE_ASM
20#define POLARSSL_HAVE_TIME
21#define POLARSSL_HAVE_IPV6
22
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000023/* mbed TLS feature support */
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020024#define POLARSSL_ECP_DP_SECP256R1_ENABLED
25#define POLARSSL_ECP_DP_SECP384R1_ENABLED
26#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
27#define POLARSSL_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard86b29082014-11-06 02:28:34 +010028#define POLARSSL_SSL_DISABLE_RENEGOTIATION
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020029
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000030/* mbed TLS modules */
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020031#define POLARSSL_AES_C
32#define POLARSSL_ASN1_PARSE_C
33#define POLARSSL_ASN1_WRITE_C
34#define POLARSSL_BIGNUM_C
35#define POLARSSL_CIPHER_C
36#define POLARSSL_CTR_DRBG_C
37#define POLARSSL_ECDH_C
38#define POLARSSL_ECDSA_C
39#define POLARSSL_ECP_C
40#define POLARSSL_ENTROPY_C
41#define POLARSSL_GCM_C
42#define POLARSSL_MD_C
43#define POLARSSL_NET_C
44#define POLARSSL_OID_C
45#define POLARSSL_PK_C
46#define POLARSSL_PK_PARSE_C
47#define POLARSSL_SHA256_C
48#define POLARSSL_SHA512_C
49#define POLARSSL_SSL_CLI_C
50#define POLARSSL_SSL_SRV_C
51#define POLARSSL_SSL_TLS_C
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020052#define POLARSSL_X509_CRT_PARSE_C
53#define POLARSSL_X509_USE_C
54
55/* For test certificates */
56#define POLARSSL_BASE64_C
57#define POLARSSL_CERTS_C
58#define POLARSSL_PEM_PARSE_C
59
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020060/* Save RAM at the expense of ROM */
61#define POLARSSL_AES_ROM_TABLES
62
63/* Save RAM by adjusting to our exact needs */
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020064#define POLARSSL_ECP_MAX_BITS 384
Manuel Pégourié-Gonnard417670a2014-06-24 17:50:22 +020065#define POLARSSL_MPI_MAX_SIZE 48 // 384 bits is 48 bytes
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020066
67/* Save RAM at the expense of speed, see ecp.h */
68#define POLARSSL_ECP_WINDOW_SIZE 2
69#define POLARSSL_ECP_FIXED_POINT_OPTIM 0
70
Manuel Pégourié-Gonnard0de7f942014-12-01 12:21:01 +010071/* Significant speed benefit at the expense of some ROM */
72#define POLARSSL_ECP_NIST_OPTIM
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020073
74/*
75 * You should adjust this to the exact number of sources you're using: default
Manuel Pégourié-Gonnard66e20c62014-06-24 17:47:40 +020076 * is the "platform_entropy_poll" source, but you may want to add other ones.
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020077 * Minimum is 2 for the entropy test suite.
78 */
79#define ENTROPY_MAX_SOURCES 2
80
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020081/* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
82#define SSL_CIPHERSUITES \
83 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, \
84 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
85
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020086/*
87 * Save RAM at the expense of interoperability: do this only if you control
88 * both ends of the connection! (See coments in "polarssl/ssl.h".)
89 * The minimum size here depends on the certificate chain used as well as the
90 * typical size of records.
91 */
92#define SSL_MAX_CONTENT_LEN 1024
Manuel Pégourié-Gonnard684e9dc2013-09-20 15:11:44 +020093
Manuel Pégourié-Gonnard725e7f42014-06-23 20:08:39 +020094#include "polarssl/check_config.h"
Manuel Pégourié-Gonnard14d55952014-04-30 12:35:08 +020095
Manuel Pégourié-Gonnard0bc1f232014-04-30 11:53:50 +020096#endif /* POLARSSL_CONFIG_H */