Merge pull request #7144 from k-stachowiak/add-cmac-to-mbedtls

Add configuration options to enable CMAC in mbedtls by default
pull/7174/head
Cruz Monrreal 2018-06-07 14:44:22 -05:00 committed by GitHub
commit fd6f3cd4a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 1 deletions

View File

@ -68,8 +68,9 @@ deploy: rsync
# Adjusting the default mbed TLS config file to mbed purposes
./adjust-config.sh $(MBED_TLS_DIR)/scripts/config.pl $(TARGET_INC)/mbedtls/config.h
#
# Copy the trimmed config that does not require entropy source
# Copy and adjust the trimmed config that does not require entropy source
cp $(MBED_TLS_DIR)/configs/config-no-entropy.h $(TARGET_INC)/mbedtls/.
./adjust-no-entropy-config.sh $(MBED_TLS_DIR)/scripts/config.pl $(TARGET_INC)/mbedtls/config-no-entropy.h
deploy-tests: deploy
#

View File

@ -112,6 +112,8 @@ conf unset MBEDTLS_RIPEMD160_C
conf unset MBEDTLS_SHA1_C
conf unset MBEDTLS_XTEA_C
conf set MBEDTLS_CMAC_C
conf set MBEDTLS_AES_ROM_TABLES
conf unset MBEDTLS_X509_RSASSA_PSS_SUPPORT

View File

@ -0,0 +1,38 @@
#!/bin/sh
#
# This file is part of mbed TLS (https://tls.mbed.org)
#
# Copyright (c) 2018, ARM Limited, All Rights Reserved
#
# Purpose
#
# Comments and uncomments #define lines in the given configuration header file
# to configure the file for use in mbed OS.
#
# Usage: adjust-no-entropy-config.sh [path to config script] [path to no-entropy config file]
#
set -eu
if [ $# -ne 2 ]; then
echo "Usage: $0 path/to/config.pl path/to/config.h" >&2
exit 1
fi
SCRIPT=$1
FILE=$2
conf() {
$SCRIPT -o -f $FILE $@
}
add_code() {
MATCH_PATTERN="$1"
shift
CODE=$(IFS=""; printf "%s" "$*")
perl -i -pe \
"s/$MATCH_PATTERN/$MATCH_PATTERN$CODE/igs" \
"$FILE"
}
conf set MBEDTLS_CMAC_C