-
Notifications
You must be signed in to change notification settings - Fork 96
Test a build without any asymmetric cryptography #298
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
Changes from all commits
fec3064
b16841e
581bfcf
ccfc5ea
dd61a2e
1a9bd94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/** | ||
* \file config-symmetric-only.h | ||
* | ||
* \brief Configuration without any asymmetric cryptography. | ||
*/ | ||
/* | ||
* Copyright (C) 2019, 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) | ||
*/ | ||
|
||
#ifndef MBEDTLS_CONFIG_H | ||
#define MBEDTLS_CONFIG_H | ||
|
||
/* System support */ | ||
//#define MBEDTLS_HAVE_ASM | ||
#define MBEDTLS_HAVE_TIME | ||
#define MBEDTLS_HAVE_TIME_DATE | ||
|
||
/* Mbed Crypto feature support */ | ||
#define MBEDTLS_CIPHER_MODE_CBC | ||
#define MBEDTLS_CIPHER_MODE_CFB | ||
#define MBEDTLS_CIPHER_MODE_CTR | ||
#define MBEDTLS_CIPHER_MODE_OFB | ||
#define MBEDTLS_CIPHER_MODE_XTS | ||
#define MBEDTLS_CIPHER_PADDING_PKCS7 | ||
#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS | ||
#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN | ||
#define MBEDTLS_CIPHER_PADDING_ZEROS | ||
#define MBEDTLS_ERROR_STRERROR_DUMMY | ||
#define MBEDTLS_FS_IO | ||
#define MBEDTLS_ENTROPY_NV_SEED | ||
#define MBEDTLS_SELF_TEST | ||
#define MBEDTLS_USE_PSA_CRYPTO | ||
#define MBEDTLS_VERSION_FEATURES | ||
|
||
/* Mbed Crypto modules */ | ||
#define MBEDTLS_AES_C | ||
#define MBEDTLS_ARC4_C | ||
#define MBEDTLS_ASN1_PARSE_C | ||
#define MBEDTLS_ASN1_WRITE_C | ||
#define MBEDTLS_BASE64_C | ||
#define MBEDTLS_BLOWFISH_C | ||
#define MBEDTLS_CAMELLIA_C | ||
#define MBEDTLS_ARIA_C | ||
#define MBEDTLS_CCM_C | ||
#define MBEDTLS_CHACHA20_C | ||
#define MBEDTLS_CHACHAPOLY_C | ||
#define MBEDTLS_CIPHER_C | ||
#define MBEDTLS_CMAC_C | ||
#define MBEDTLS_CTR_DRBG_C | ||
#define MBEDTLS_DES_C | ||
#define MBEDTLS_ENTROPY_C | ||
#define MBEDTLS_ERROR_C | ||
#define MBEDTLS_GCM_C | ||
//#define MBEDTLS_HAVEGE_C | ||
#define MBEDTLS_HKDF_C | ||
#define MBEDTLS_HMAC_DRBG_C | ||
#define MBEDTLS_NIST_KW_C | ||
#define MBEDTLS_MD_C | ||
#define MBEDTLS_MD2_C | ||
#define MBEDTLS_MD4_C | ||
#define MBEDTLS_MD5_C | ||
#define MBEDTLS_OID_C | ||
#define MBEDTLS_PEM_PARSE_C | ||
#define MBEDTLS_PEM_WRITE_C | ||
#define MBEDTLS_PKCS5_C | ||
#define MBEDTLS_PKCS12_C | ||
#define MBEDTLS_PLATFORM_C | ||
#define MBEDTLS_POLY1305_C | ||
#define MBEDTLS_PSA_CRYPTO_C | ||
#define MBEDTLS_PSA_CRYPTO_SE_C | ||
#define MBEDTLS_PSA_CRYPTO_STORAGE_C | ||
#define MBEDTLS_PSA_ITS_FILE_C | ||
#define MBEDTLS_RIPEMD160_C | ||
#define MBEDTLS_SHA1_C | ||
#define MBEDTLS_SHA256_C | ||
#define MBEDTLS_SHA512_C | ||
//#define MBEDTLS_THREADING_C | ||
#define MBEDTLS_TIMING_C | ||
#define MBEDTLS_VERSION_C | ||
#define MBEDTLS_XTEA_C | ||
|
||
#include "check_config.h" | ||
|
||
#endif /* MBEDTLS_CONFIG_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -565,16 +565,17 @@ static int check_persistent_data( psa_key_lifetime_t lifetime, | |
psa_storage_uid_t uid = file_uid_for_lifetime( lifetime ); | ||
struct psa_storage_info_t info; | ||
uint8_t *loaded = NULL; | ||
int ok = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In such cases I'd rather use "is_ok" to show that it's a boolean, but that's an opinion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
PSA_ASSERT( psa_its_get_info( uid, &info ) ); | ||
ASSERT_ALLOC( loaded, info.size ); | ||
PSA_ASSERT( psa_its_get( uid, 0, info.size, loaded, NULL ) ); | ||
ASSERT_COMPARE( expected_data, size, loaded, info.size ); | ||
return( 1 ); | ||
ok = 1; | ||
|
||
exit: | ||
mbedtls_free( loaded ); | ||
return( 0 ); | ||
return( ok ); | ||
} | ||
|
||
/* Check that a function's return status is "smoke-free", i.e. that | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this line left in, even though it's commented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of options commented out because I thought that they were options that should not be enabled in our test configuration, but could be useful to users who want to make a symmetric-only configuration tuned to their use case, and use this file as a starting point.