mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 21:05:37 +00:00
e783d34543
In preparation for the import/export format change for private elliptic curve keys from RFC 5915 to the raw secret value, transform the test data to the new format. Tests will not pass until the implementation has been changed to the new format and some test cases and test functions have been adjusted. I used the script below to look for lines containing a PSA_KEY_TYPE_ECC_KEYPAIR and change the first hex string in the line with an ASN.1 header that looks like the beginning of an RFC 5915 ECPrivateKey. This always happens to be a private key input. perl -a -F: -i -pe 'sub pad { local ($_) = @_; s/^00// if length == $digits + 2; die if length > $digits; sprintf("\"%0${digits}s\"", $_) } if ($F[0] !~ /\W/ && /:PSA_KEY_TYPE_ECC_KEYPAIR\( *PSA_ECC_CURVE_[A-Z_]+([0-9]+)/) {$digits = int(($1+7)/8)*2; s/"30(?:[0-7].|81..|82....)02010104(..)([0-9a-f]+)"/pad(substr($2, 0, hex($1)*2))/ie}' tests/suites/test_suite_psa_crypto.data |
||
---|---|---|
.. | ||
.jenkins | ||
data_files | ||
git-scripts | ||
scripts | ||
suites | ||
.gitignore | ||
CMakeLists.txt | ||
compat.sh | ||
Descriptions.txt | ||
Makefile | ||
ssl-opt.sh |