Skip to content

Commit bd1a8ab

Browse files
Merge pull request #33 from gowthamsk-arm/update_mbedtls_version
Update to mbedtls version to 3.0.0
2 parents 0857237 + 78bb6ea commit bd1a8ab

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
toolchain: stable
2323
override: true
2424
- name: Download Mbed Crypto
25-
run: git clone -b mbedtls-2.27.0 https://github.com/ARMmbed/mbedtls.git
25+
run: git clone -b v3.0.0 https://github.com/ARMmbed/mbedtls.git
2626
- name: armv7-unknown-linux-gnueabihf
2727
run: |
2828
rustup target add armv7-unknown-linux-gnueabihf

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ script:
66
# Compile Mbed Crypto for the test application
77
- git clone https://github.com/ARMmbed/mbedtls.git
88
- pushd mbedtls
9-
- git checkout mbedtls-2.27.0
9+
- git checkout v3.0.0
1010
- ./scripts/config.py crypto
1111
- ./scripts/config.py set MBEDTLS_PSA_CRYPTO_SE_C
1212
- SHARED=1 make

ci/c-tests/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int main()
5353
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_PERSISTENCE_DEFAULT, (psa_key_location_t)0x000001));
5454
psa_set_key_usage_flags(&key_pair_attributes, PSA_KEY_USAGE_SIGN_HASH | PSA_KEY_USAGE_VERIFY_HASH);
5555
psa_set_key_algorithm(&key_pair_attributes, alg);
56-
psa_set_key_type(&key_pair_attributes, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_CURVE_SECP_R1));
56+
psa_set_key_type(&key_pair_attributes, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1));
5757
psa_set_key_bits(&key_pair_attributes, 256U);
5858

5959
status = psa_generate_key(&key_pair_attributes, &key_pair_handle);

ci/ci.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ then
1414
git clone https://github.com/ARMmbed/mbedtls.git
1515
fi
1616
pushd mbedtls
17-
git checkout mbedtls-2.27.0
17+
git checkout v3.0.0
1818
popd
1919

2020
#################
@@ -32,7 +32,7 @@ fi
3232
# C Tests #
3333
###########
3434

35-
cp /tmp/NVChip .
35+
cp /tmp/ondisk/NVChip .
3636
# Start and configure TPM server
3737
tpm_server &
3838
sleep 5

src/asymmetric.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ use psa_crypto::types::algorithm::AsymmetricSignature;
1010
use std::convert::TryFrom;
1111

1212
pub(super) static METHODS: psa_drv_se_asymmetric_t = psa_drv_se_asymmetric_t {
13-
p_sign: Some(p_sign),
14-
p_verify: Some(p_verify),
15-
p_encrypt: None,
16-
p_decrypt: None,
13+
private_p_sign: Some(p_sign),
14+
private_p_verify: Some(p_verify),
15+
private_p_encrypt: None,
16+
private_p_decrypt: None,
1717
};
1818

1919
unsafe extern "C" fn p_sign(

src/key_management.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use psa_crypto::types::key::Attributes;
1010
use std::convert::TryFrom;
1111

1212
pub(super) static METHODS: psa_drv_se_key_management_t = psa_drv_se_key_management_t {
13-
p_allocate: Some(p_allocate),
14-
p_validate_slot_number: Some(p_validate_slot_number),
15-
p_import: Some(p_import),
16-
p_generate: Some(p_generate),
17-
p_destroy: Some(p_destroy),
18-
p_export: None,
19-
p_export_public: Some(p_export_public),
13+
private_p_allocate: Some(p_allocate),
14+
private_p_validate_slot_number: Some(p_validate_slot_number),
15+
private_p_import: Some(p_import),
16+
private_p_generate: Some(p_generate),
17+
private_p_destroy: Some(p_destroy),
18+
private_p_export: None,
19+
private_p_export_public: Some(p_export_public),
2020
};
2121

2222
unsafe extern "C" fn p_allocate(

src/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ lazy_static! {
6767
/// Parsec SE Driver structure
6868
#[no_mangle]
6969
pub static mut PARSEC_SE_DRIVER: psa_drv_se_t = psa_drv_se_t {
70-
hal_version: 5,
71-
persistent_data_size: 0,
72-
p_init: Some(p_init),
73-
key_management: &key_management::METHODS as *const psa_drv_se_key_management_t,
74-
mac: ptr::null(),
75-
cipher: ptr::null(),
76-
aead: ptr::null(),
77-
asymmetric: &asymmetric::METHODS as *const psa_drv_se_asymmetric_t,
78-
derivation: ptr::null(),
70+
private_hal_version: 5,
71+
private_persistent_data_size: 0,
72+
private_p_init: Some(p_init),
73+
private_key_management: &key_management::METHODS as *const psa_drv_se_key_management_t,
74+
private_mac: ptr::null(),
75+
private_cipher: ptr::null(),
76+
private_aead: ptr::null(),
77+
private_asymmetric: &asymmetric::METHODS as *const psa_drv_se_asymmetric_t,
78+
private_derivation: ptr::null(),
7979
};
8080

8181
unsafe extern "C" fn p_init(

0 commit comments

Comments
 (0)