Skip to content

[DO NOT MERGE] Unremove tls files in preparation for the repository merge #384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
40f17dc
Revert "Remove certs.h"
gilles-peskine-arm Feb 26, 2020
db7d5f0
Revert "config: Remove explicit ciphersuite lists"
gilles-peskine-arm Feb 26, 2020
84a63fa
Revert "tests: Update generator with Mbed Crypto comments"
gilles-peskine-arm Feb 26, 2020
9bf54fa
Revert "doxygen: Update for Mbed Crypto"
gilles-peskine-arm Feb 26, 2020
302e43f
Revert "scripts: Remove unneeded scripts"
gilles-peskine-arm Feb 26, 2020
32d90b3
Revert "Remove unused test data files"
gilles-peskine-arm Feb 26, 2020
1fcf721
Revert "scripts: Remove dependency on NET"
gilles-peskine-arm Feb 26, 2020
1bf45e1
Revert "scripts: Remove dependency on X.509"
gilles-peskine-arm Feb 26, 2020
314bc89
Revert "scripts: Remove dependency on TLS"
gilles-peskine-arm Feb 26, 2020
458b8f2
Revert "Remove unused TLS, NET, and X.509 files"
gilles-peskine-arm Feb 26, 2020
252e391
Revert "config: Remove X.509 options"
gilles-peskine-arm Feb 26, 2020
4e11749
Revert "config: Remove TLS and NET options"
gilles-peskine-arm Feb 26, 2020
9d28c42
Revert "check-names: Enable referencing Mbed TLS macros"
gilles-peskine-arm Feb 26, 2020
12230eb
Revert "Remove irrelevant configs"
gilles-peskine-arm Feb 26, 2020
722a7e6
Revert "Only build libmbedcrypto"
gilles-peskine-arm Feb 26, 2020
4fa9f9f
Revert "programs, tests: Depend only on libmbedcrypto"
gilles-peskine-arm Feb 26, 2020
70824f2
Revert "Remove programs that depend on TLS or X.509"
gilles-peskine-arm Feb 26, 2020
5bb8bec
Revert "Remove zlib"
gilles-peskine-arm Feb 26, 2020
6bbe783
Revert "Remove pkcs11-helper option"
gilles-peskine-arm Feb 26, 2020
b85b20d
Revert "tests: Add a crypto prefix to submodule tests"
gilles-peskine-arm Feb 26, 2020
5748757
Revert "tests: Exclude version suite when used as a submodule"
gilles-peskine-arm Feb 26, 2020
1a9c624
Revert "tests: Use parent module includes when used as a submodule"
gilles-peskine-arm Feb 26, 2020
7dc9704
Revert "Remove tests that depend on TLS or X.509"
gilles-peskine-arm Feb 26, 2020
920b775
Revert "recursion.pl: Don't depend on X.509"
gilles-peskine-arm Feb 26, 2020
9e277f4
Revert "cpp_dummy_build: Remove X.509 dependency"
gilles-peskine-arm Feb 26, 2020
96ddb0a
Revert "asn1: Remove dependency on X.509"
gilles-peskine-arm Feb 26, 2020
69e8f7f
Revert "all.sh: Remove dependency on TLS, NET, and X.509"
gilles-peskine-arm Feb 26, 2020
d40f007
Revert "dhm: Remove dependency on TLS"
gilles-peskine-arm Feb 26, 2020
1174db5
Revert "ecp: Remove dependency on TLS and X.509"
gilles-peskine-arm Feb 26, 2020
3a67150
Revert "md: Remove dependency on X.509"
gilles-peskine-arm Feb 26, 2020
1690874
Revert "pkey: Remove dependency on X.509"
gilles-peskine-arm Feb 26, 2020
1bc9c13
Revert "selftest: Remove X.509 selftest"
gilles-peskine-arm Feb 26, 2020
f66346e
Revert "Remove Diffie-Hellman examples"
gilles-peskine-arm Feb 26, 2020
7e771c7
Link test programs that only use platform functions with mbedcrypto
gilles-peskine-arm Feb 18, 2020
3b46cd3
Invoke config.py instead of config.pl in reverted content
gilles-peskine-arm Feb 18, 2020
43aa905
DHM functions are not part of x509
gilles-peskine-arm Mar 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ script:
- make
- make test
- programs/test/selftest
- OSSL_NO_DTLS=1 tests/compat.sh
- tests/ssl-opt.sh -e '\(DTLS\|SCSV\).*openssl' --seed 4
- tests/scripts/test-ref-configs.pl
- tests/scripts/curves.pl
- tests/scripts/key-exchanges.pl
after_failure:
- tests/scripts/travis-log-failure.sh
env:
global:
- SEED=1
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif()
# Set the project root directory.
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})

option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)

option(ENABLE_PROGRAMS "Build mbed TLS programs." ON)

option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF)
Expand Down Expand Up @@ -179,6 +182,14 @@ endif()
include_directories(include/)
include_directories(library/)

if(ENABLE_ZLIB_SUPPORT)
find_package(ZLIB)

if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
endif(ZLIB_FOUND)
endif(ENABLE_ZLIB_SUPPORT)

add_subdirectory(include)

add_subdirectory(3rdparty)
Expand Down Expand Up @@ -207,6 +218,8 @@ if(ENABLE_TESTING)
ADD_CUSTOM_TARGET(covtest
COMMAND make test
COMMAND programs/test/selftest
COMMAND tests/compat.sh
COMMAND tests/ssl-opt.sh
)

ADD_CUSTOM_TARGET(lcov
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ install: no_test
cp -rp include/psa $(DESTDIR)/include

mkdir -p $(DESTDIR)/lib
cp -RP library/libmbedtls.* $(DESTDIR)/lib
cp -RP library/libmbedx509.* $(DESTDIR)/lib
cp -RP library/libmbedcrypto.* $(DESTDIR)/lib

mkdir -p $(DESTDIR)/bin
Expand All @@ -40,6 +42,8 @@ install: no_test

uninstall:
rm -rf $(DESTDIR)/include/mbedtls
rm -f $(DESTDIR)/lib/libmbedtls.*
rm -f $(DESTDIR)/lib/libmbedx509.*
rm -f $(DESTDIR)/lib/libmbedcrypto.*

for p in programs/*/* ; do \
Expand Down Expand Up @@ -97,6 +101,8 @@ ifndef WINDOWS
covtest:
$(MAKE) check
programs/test/selftest
tests/compat.sh
tests/ssl-opt.sh

lcov:
rm -rf Coverage
Expand Down
4 changes: 2 additions & 2 deletions configs/README.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
This directory contains example configuration files.

The examples are generally focused on a particular usage case (eg, support for
a restricted number of TLS ciphersuites) and aim at minimizing resource usage
for this target. They can be used as a basis for custom configurations.
a restricted number of ciphersuites) and aim at minimizing resource usage for
this target. They can be used as a basis for custom configurations.

These files are complete replacements for the default config.h. To use one of
them, you can pick one of the following methods:
Expand Down
88 changes: 88 additions & 0 deletions configs/config-ccm-psk-tls1_2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/**
* \file config-ccm-psk-tls1_2.h
*
* \brief Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
/*
* Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
* Distinguishing features:
* - no bignum, no PK, no X509
* - fully modern and secure (provided the pre-shared keys have high entropy)
* - very low record overhead with CCM-8
* - optimized for low RAM usage
*
* See README.txt for usage instructions.
*/
#ifndef MBEDTLS_CONFIG_H
#define MBEDTLS_CONFIG_H

/* System support */
//#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */
/* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */

/* mbed TLS feature support */
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
#define MBEDTLS_SSL_PROTO_TLS1_2

/* mbed TLS modules */
#define MBEDTLS_AES_C
#define MBEDTLS_CCM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_ENTROPY_C
#define MBEDTLS_MD_C
#define MBEDTLS_NET_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_SRV_C
#define MBEDTLS_SSL_TLS_C

/* Save RAM at the expense of ROM */
#define MBEDTLS_AES_ROM_TABLES

/* Save some RAM by adjusting to your exact needs */
#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */

/*
* You should adjust this to the exact number of sources you're using: default
* is the "platform_entropy_poll" source, but you may want to add other ones
* Minimum is 2 for the entropy test suite.
*/
#define MBEDTLS_ENTROPY_MAX_SOURCES 2

/*
* Use only CCM_8 ciphersuites, and
* save ROM and a few bytes of RAM by specifying our own ciphersuite list
*/
#define MBEDTLS_SSL_CIPHERSUITES \
MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8

/*
* Save RAM at the expense of interoperability: do this only if you control
* both ends of the connection! (See comments in "mbedtls/ssl.h".)
* The optimal size here depends on the typical size of records.
*/
#define MBEDTLS_SSL_MAX_CONTENT_LEN 1024

#include "mbedtls/check_config.h"

#endif /* MBEDTLS_CONFIG_H */
Loading