Skip to content

Change MbedTLS configuration to use the Mbed OS configuration system #9669

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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
05c2203
Add Mbed OS JSON configuration options to the MbedTLS Library
dreemkiller Mar 6, 2018
1bae578
Added license headers and changed coding style (where appropriate)
dreemkiller Apr 25, 2018
526b301
Removed some spaces to comply with the style guidelines
dreemkiller Apr 26, 2018
37e95a7
Removed the MBED_CLOUD_CLIENT and MBED_MINI_CLOUD_CLIENT config options
dreemkiller May 9, 2018
2b3cd6d
Changed mbed_cloud_client_* to pelion_client
dreemkiller Feb 11, 2019
37f9c7c
Removed mini client test case
dreemkiller Feb 11, 2019
5e6c905
A small amount of cleanup
dreemkiller Feb 11, 2019
b2d6731
Removed the mbedtls.config connection test as it's redundant to the T…
dreemkiller Feb 12, 2019
2388a84
style changes to satisfy astyle
dreemkiller Feb 12, 2019
4a7d56d
style changes to satisfy astyle
dreemkiller Feb 12, 2019
c87af06
Changed mbedtls configuration parameters to lowercase
dreemkiller Feb 13, 2019
98f9306
More astyle changes
dreemkiller Feb 13, 2019
60545ee
Changed the app-config-file option to be additive instead of comprehe…
dreemkiller Feb 13, 2019
c18af74
Changed the order of the options so that app-config-file has the last…
dreemkiller Feb 14, 2019
819d711
Changed the return code being checked for unsupported algorithms in a…
dreemkiller Feb 20, 2019
093c243
Moved mbedtls_config_reader.h to the mbedtls/platform directory
dreemkiller Feb 20, 2019
6cde4ef
Added checks for platforms with no entropy source
dreemkiller Feb 21, 2019
2d5d3f2
Removed stray SHA256 define
dreemkiller Feb 21, 2019
07186e6
Removed a stray #define
dreemkiller Feb 21, 2019
42af1df
Removed a merge-indicator from mbedtls_config_reader.h
dreemkiller Feb 21, 2019
9ef60ed
Restored the configuration test jsons to make testing easier in the f…
dreemkiller Feb 21, 2019
a759e8b
Added null testcase for mbedtls.config so cases[] is not empty when n…
dreemkiller Feb 22, 2019
733609d
Added an mbedtls.config all-off configuration for testing non-entropy…
dreemkiller Feb 22, 2019
c23623c
removbed the default defines from mbedtls mbed_lib.json
dreemkiller Feb 22, 2019
2c0a7bc
modified mbedtls adjust_config.sh for new config changes. updated con…
dreemkiller Feb 22, 2019
c090a89
modified mbedtls_config_reader.h to enable builds no no-entropy platf…
dreemkiller Feb 22, 2019
5498b5e
Changed the way non-entropy platforms are configured, enabling builds…
dreemkiller Feb 22, 2019
3889a1e
added #warning for inconsistent mbedtls ocnfigurations
dreemkiller Feb 25, 2019
5099e0e
Fixed a typo in one of the MBed TLS #defines
dreemkiller Feb 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
566 changes: 566 additions & 0 deletions TESTS/mbedtls/config/aes_test.cpp

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions TESTS/mbedtls/config/aes_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2013-2018, 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.
*/

#ifndef __AES_TEST_H__
#define __AES_TEST_H__

int mbedtls_aes_ecb_test_mbedos(int verbose);
int mbedtls_aes_cbc_test_mbedos(int verbose);
int mbedtls_aes_cfb_test_mbedos(int verbose);
int mbedtls_aes_ctr_test_mbedos(int verbose);

#endif // __AES_TEST_H__
37 changes: 37 additions & 0 deletions TESTS/mbedtls/config/ecdh_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2013-2018, 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.
*/

#include <stdio.h>
#include <string.h>
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity/unity.h"
#include "utest/utest.h"
#include "mbedtls/ecdh.h"
#include "ecdh_test.h"

#if defined (MBEDTLS_ECDH_C)
/* Tests whether the mbedtls_ecdh_* functions are included in the build configuration
* It never generates asserts. Instead, failures should show up at compile time
*/
int mbedtls_ecdh_test_mbedos(int verbose)
{
mbedtls_ecdh_make_params(NULL, NULL, NULL, 0, NULL, NULL);

return 0;
}
#endif // MBEDTLS_ECDH_C
23 changes: 23 additions & 0 deletions TESTS/mbedtls/config/ecdh_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2013-2018, 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.
*/

#ifndef __ECDH_TEST_H__
#define __ECDH_TEST_H__

int mbedtls_ecdh_test_mbedos(int verbose);

#endif // __ECDH_TEST_H__
39 changes: 39 additions & 0 deletions TESTS/mbedtls/config/ecdsa_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2013-2018, ARM Limited, All Rights Reserved

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Please update the copyright date in all the new files.

* 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.
*/
#include <stdio.h>
#include <string.h>
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity/unity.h"
#include "utest/utest.h"
#include "mbedtls/ecdsa.h"
#include "ecdsa_test.h"

#if defined(MBEDTLS_ECDSA_C)
/* Tests whether the mbedtls_ecdsa_* functions are included in the build configuration
* This test does not generate asserts. Instead, a failure will cause a compile error
* Testing the functionality of the ecdsa functions is beyond the scope
*/
int mbedtls_ecdsa_test_mbedos(int verbose)
{
mbedtls_ecp_group group;
group.N.p = NULL; // will cause the ecdsa function to exit early
mbedtls_ecdsa_sign(&group, NULL, NULL, NULL, NULL, 0, NULL, NULL);

return 0;
}
#endif // MBEDTLS_ECDSA_C
23 changes: 23 additions & 0 deletions TESTS/mbedtls/config/ecdsa_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2013-2018, 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.
*/

#ifndef __ECDSA_TEST_H__
#define __ECDSA_TEST_H__

int mbedtls_ecdsa_test_mbedos(int verbose);

#endif // __ECDSA_TEST_H__
Loading