-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Comparing changes
Open a pull request
base repository: Mbed-TLS/mbedtls
base: 30e0623c7c9c8019f87e807f59e43259e45c1f11
head repository: Mbed-TLS/mbedtls
compare: e5ae132d8742de5fc9548f8c52155031dd4d5dc6
Commits on Sep 21, 2022
-
Add bignum test generation framework
Adds python script for generation of bignum test cases, with initial classes for mpi_cmp_mpi test cases. Build scripts are updated to generate test data. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 545911f - Browse repository at this point
Copy the full SHA 545911fView commit details -
Add test generation for bignum cmp variant
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 423f99b - Browse repository at this point
Copy the full SHA 423f99bView commit details -
Add test case generation for bignum add
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 5c1173b - Browse repository at this point
Copy the full SHA 5c1173bView commit details -
Sort tests when generating cases
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 1c413bd - Browse repository at this point
Copy the full SHA 1c413bdView commit details -
Remove set() to preserve test case order
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 1bdee22 - Browse repository at this point
Copy the full SHA 1bdee22View commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for d76c5ed - Browse repository at this point
Copy the full SHA d76c5edView commit details -
Remove is None from if statement
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for f0910ae - Browse repository at this point
Copy the full SHA f0910aeView commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 92bb1cd - Browse repository at this point
Copy the full SHA 92bb1cdView commit details -
Separate common test generation classes/functions
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for dcad1e9 - Browse repository at this point
Copy the full SHA dcad1e9View commit details -
Remove abbreviations and clarify attributes
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 70d3f3d - Browse repository at this point
Copy the full SHA 70d3f3dView commit details -
Remove unneeded list concatenation
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 02998c4 - Browse repository at this point
Copy the full SHA 02998c4View commit details -
Convert bools to int before arithmetic
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 1c2a732 - Browse repository at this point
Copy the full SHA 1c2a732View commit details -
Clarification is added to docstrings, mostly in abstract classes. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 008d90d - Browse repository at this point
Copy the full SHA 008d90dView commit details -
Use ABCMeta for abstract classes
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 47e37b3 - Browse repository at this point
Copy the full SHA 47e37b3View commit details -
Split generate_tests to reduce code complexity
Previous implementation mixed the test case generation and the recursive generation calls together. A separate method is added to generate test cases for the current class' test function. This reduces the need to override generate_tests(). Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for c34d037 - Browse repository at this point
Copy the full SHA c34d037View commit details -
Use __new__() for case counting
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for cace1aa - Browse repository at this point
Copy the full SHA cace1aaView commit details -
Remove trailing whitespace in description
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 6d04142 - Browse repository at this point
Copy the full SHA 6d04142View commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 9509f44 - Browse repository at this point
Copy the full SHA 9509f44View commit details -
Use typing casts for fixed-width tuples
Enforces fixed-width tuple types where mypy does not recognize. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 478a4ce - Browse repository at this point
Copy the full SHA 478a4ceView commit details -
Disable pylint unused arg in __new__
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 486d258 - Browse repository at this point
Copy the full SHA 486d258View commit details -
Raise NotImplementedError in abstract methods
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for d77d33d - Browse repository at this point
Copy the full SHA d77d33dView commit details -
Fix TARGET types and code style
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 412c497 - Browse repository at this point
Copy the full SHA 412c497View commit details -
Disable abstract check in pylint
Version of pylint used in CI does not recognize abstract subclasses of BaseTarget, so disable warning in these abstract classes. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for b29f59f - Browse repository at this point
Copy the full SHA b29f59fView commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for b03420f - Browse repository at this point
Copy the full SHA b03420fView commit details -
Use argparser default for targets
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for ac86390 - Browse repository at this point
Copy the full SHA ac86390View commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 6f67bae - Browse repository at this point
Copy the full SHA 6f67baeView commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 2b0f7d8 - Browse repository at this point
Copy the full SHA 2b0f7d8View commit details -
Use
combinations_with_replacement
for inputsWhen generating combinations of values, `itertools.combinations` will not allow inputs to be repeated. This is replaced so that cases where input values match are generated, i.e. ("0", "0"). Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 18f94d8 - Browse repository at this point
Copy the full SHA 18f94d8View commit details -
Add dependencies attribute to BaseTarget
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 486b341 - Browse repository at this point
Copy the full SHA 486b341View commit details -
Use Python 3.5 style typing for dependencies
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 6cc5e5f - Browse repository at this point
Copy the full SHA 6cc5e5fView commit details -
Rework TestGenerator to add file targets
BaseTarget-derived targets are now added to TestGenerator.targets in initialization. This reduces repeated code in generate_xxx_tests.py scripts which use this framework. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 0d07e86 - Browse repository at this point
Copy the full SHA 0d07e86View commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for e53be35 - Browse repository at this point
Copy the full SHA e53be35View commit details -
Use simpler int to hex string conversion
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 3edcee7 - Browse repository at this point
Copy the full SHA 3edcee7View commit details -
Move symbol definition out of __init__
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 46c09a6 - Browse repository at this point
Copy the full SHA 46c09a6View commit details -
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 8b2d14b - Browse repository at this point
Copy the full SHA 8b2d14bView commit details -
Update comments/docstrings in TestGenerator
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for f518276 - Browse repository at this point
Copy the full SHA f518276View commit details -
Add toggle for test case count in descriptions
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 113ddd0 - Browse repository at this point
Copy the full SHA 113ddd0View commit details -
Use typing.cast instead of unqualified cast
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 1965d48 - Browse repository at this point
Copy the full SHA 1965d48View commit details -
Add combination_pairs helper function
Wrapper function for itertools.combinations_with_replacement, with explicit cast due to imprecise typing with older versions of mypy. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 38c2491 - Browse repository at this point
Copy the full SHA 38c2491View commit details -
Update references to file targets in docstrings
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 64334d9 - Browse repository at this point
Copy the full SHA 64334d9View commit details -
Use a script specific description in CLI help
Previous changes used the docstring of the test_generation module, which does not inform a user about the script. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 4ed94a4 - Browse repository at this point
Copy the full SHA 4ed94a4View commit details -
Add file generated by generate_bignum_tests.py
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 05998a0 - Browse repository at this point
Copy the full SHA 05998a0View commit details
Commits on Oct 4, 2022
-
This comment (which used to be attached to the implementation, and should not have been moved to the header file) is incorrect: the library function mbedtls_mpi_read_string preserves leading zeros as desired, but does not create a zero-limb object for an empty string. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 9538c90 - Browse repository at this point
Copy the full SHA 9538c90View commit details -
Allow test assertions on constant-flow scalar data
When testing a function that is supposed to be constant-flow, we declare the inputs as constant-flow secrets with TEST_CF_SECRET. The result of such a function is itself a constant-flow secret, so it can't be tested with comparison operators. In TEST_EQUAL, TEST_LE_U and TEST_LE_S, declare the values to be compared as public. This way, test code doesn't need to explicitly declare results as public if they're only used by one of these macros. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 7db8e89 - Browse repository at this point
Copy the full SHA 7db8e89View commit details -
Move the definition of data_t to a header file
This way it can be used in helper functions. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 34cb462 - Browse repository at this point
Copy the full SHA 34cb462View commit details -
Replace the output file atomically
When writing the new .data file, first write the new content, then replace the target. This way, there isn't a temporary state in which the file is partially written. This temporary state can be misleading if the build is interrupted. It's annoying if you're watching changes to the output and the changes appear as emptying the file following by the new version appearing. Now interrupted builds don't leave a file that appears to be up to date but isn't, and when watching the output, there's a single transition to the new version. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Configuration menu - View commit details
-
Copy full SHA for eca29e4 - Browse repository at this point
Copy the full SHA eca29e4View commit details
Commits on Oct 5, 2022
-
Include platform.h unconditionally: automatic part
We used to include platform.h only when MBEDTLS_PLATFORM_C was enabled, and to define ad hoc replacements for mbedtls_xxx functions on a case-by-case basis when MBEDTLS_PLATFORM_C was disabled. The only reason for this complication was to allow building individual source modules without copying platform.h. This is not something we support or recommend anymore, so get rid of the complication: include platform.h unconditionally. There should be no change in behavior since just including the header should not change the behavior of a program. This commit replaces most occurrences of conditional inclusion of platform.h, using the following code: ``` perl -i -0777 -pe 's!#if.*\n#include "mbedtls/platform.h"\n(#else.*\n(#define (mbedtls|MBEDTLS)_.*\n|#include <(stdarg|stddef|stdio|stdlib|string|time)\.h>\n)*)?#endif.*!#include "mbedtls/platform.h"!mg' $(git grep -l '#include "mbedtls/platform.h"') ``` Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Configuration menu - View commit details
-
Copy full SHA for 36f19b9 - Browse repository at this point
Copy the full SHA 36f19b9View commit details -
Add test components for tls 1.2 builds with single encryption type
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
Configuration menu - View commit details
-
Copy full SHA for e535270 - Browse repository at this point
Copy the full SHA e535270View commit details -
Fix guards for mbedtls_ct_size_mask() and mbedtls_ct_memcpy_if_eq()
Both functions are used when MBEDTLS_SSL_SOME_SUITES_USE_MAC is defined not MBEDTLS_SSL_SOME_SUITES_USE_TLS_CBC. Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
Configuration menu - View commit details
-
Copy full SHA for 9450dc7 - Browse repository at this point
Copy the full SHA 9450dc7View commit details -
Fix configuration requirements(MBEDTLS_SSL_CONTEXT_SERIALIZATION, MBE…
…DTLS_SSL_SESSION_TICKETS) Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
Configuration menu - View commit details
-
Copy full SHA for 864b43d - Browse repository at this point
Copy the full SHA 864b43dView commit details
There are no files selected for viewing