mbed-os-examples / Mbed OS mbed-os-example-tls-tls-client
Committer:
mbed_official
Date:
Mon Jan 28 16:15:09 2019 +0000
Revision:
95:d282bc7f32e4
Parent:
93:eeb015d879ec
Merge pull request #232 from ARMmbed/tls-client_psa

Allow the use of PSA Crypto in TLS client example
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-tls

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 12:1ae41c231014 1 /*
mbed_official 66:ce8709d9912c 2 * Copyright (C) 2006-2018, Arm Limited, All Rights Reserved
mbed_official 12:1ae41c231014 3 * SPDX-License-Identifier: Apache-2.0
mbed_official 12:1ae41c231014 4 *
mbed_official 12:1ae41c231014 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may
mbed_official 12:1ae41c231014 6 * not use this file except in compliance with the License.
mbed_official 12:1ae41c231014 7 * You may obtain a copy of the License at
mbed_official 12:1ae41c231014 8 *
mbed_official 12:1ae41c231014 9 * http://www.apache.org/licenses/LICENSE-2.0
mbed_official 12:1ae41c231014 10 *
mbed_official 12:1ae41c231014 11 * Unless required by applicable law or agreed to in writing, software
mbed_official 12:1ae41c231014 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
mbed_official 12:1ae41c231014 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbed_official 12:1ae41c231014 14 * See the License for the specific language governing permissions and
mbed_official 12:1ae41c231014 15 * limitations under the License.
mbed_official 12:1ae41c231014 16 *
mbed_official 50:b6870173bcac 17 * This file is part of Mbed TLS (https://tls.mbed.org)
mbed_official 12:1ae41c231014 18 */
mbed_official 5:8275e4cee0d5 19
mbed_official 12:1ae41c231014 20 #if !defined(MBEDTLS_ENTROPY_HARDWARE_ALT) && \
mbed_official 12:1ae41c231014 21 !defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_TEST_NULL_ENTROPY)
mbed_official 12:1ae41c231014 22 #error "This hardware does not have an entropy source."
mbed_official 12:1ae41c231014 23 #endif /* !MBEDTLS_ENTROPY_HARDWARE_ALT && !MBEDTLS_ENTROPY_NV_SEED &&
mbed_official 12:1ae41c231014 24 * !MBEDTLS_TEST_NULL_ENTROPY */
mbed_official 12:1ae41c231014 25
mbed_official 21:2089b3620a63 26 #if !defined(MBEDTLS_SHA1_C)
mbed_official 12:1ae41c231014 27 #define MBEDTLS_SHA1_C
mbed_official 21:2089b3620a63 28 #endif /* !MBEDTLS_SHA1_C */
mbed_official 5:8275e4cee0d5 29
mbed_official 12:1ae41c231014 30 /*
mbed_official 12:1ae41c231014 31 * This value is sufficient for handling 2048 bit RSA keys.
mbed_official 12:1ae41c231014 32 *
mbed_official 12:1ae41c231014 33 * Set this value higher to enable handling larger keys, but be aware that this
mbed_official 12:1ae41c231014 34 * will increase the stack usage.
mbed_official 12:1ae41c231014 35 */
mbed_official 93:eeb015d879ec 36 #undef MBEDTLS_MPI_MAX_SIZE
mbed_official 12:1ae41c231014 37 #define MBEDTLS_MPI_MAX_SIZE 256
mbed_official 5:8275e4cee0d5 38
mbed_official 95:d282bc7f32e4 39 /* This macro determines whether Mbed TLS uses its own legacy crypto library
mbed_official 95:d282bc7f32e4 40 * or an implementation of the PSA Crypto API such as Mbed Crypto.
mbed_official 95:d282bc7f32e4 41 *
mbed_official 95:d282bc7f32e4 42 * To confirm the use of PSA Crypto, you may enable debugging by setting
mbed_official 95:d282bc7f32e4 43 * HELLO_HTTPS_CLIENT_DEBUG_LEVEL in HelloHttpsClient.h and look for
mbed_official 95:d282bc7f32e4 44 * PSA-related debugging output on the serial line.
mbed_official 95:d282bc7f32e4 45 *
mbed_official 95:d282bc7f32e4 46 * Uncomment this to use the PSA Crypto API. */
mbed_official 95:d282bc7f32e4 47 //#define MBEDTLS_USE_PSA_CRYPTO
mbed_official 95:d282bc7f32e4 48
mbed_official 12:1ae41c231014 49 #define MBEDTLS_MPI_WINDOW_SIZE 1