Skip to content
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

Add various improvements #20

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

hug-dev
Copy link
Member

@hug-dev hug-dev commented Jun 1, 2020

This commit:

  • fixes a bug in build.rs where the shim library was not compiled when
    dynamically linking
  • add the psa_get_key_id function to the shim
  • allow to access psa-crypto-sys from psa-crypto if compiling with Mbed
    Crypto
  • add a conversion from Error to psa_status_t to avoid going to Status

Signed-off-by: Hugues de Valon hugues.devalon@arm.com

@hug-dev hug-dev requested a review from ionut-arm June 1, 2020 16:37
@hug-dev hug-dev self-assigned this Jun 1, 2020
@hug-dev hug-dev added the enhancement New feature or request label Jun 1, 2020
@hug-dev hug-dev force-pushed the various-improvements branch from a5c2e93 to 7e15762 Compare June 1, 2020 16:42
Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for re-arranging the build.rs file!

@@ -15,7 +15,7 @@ repository = "https://github.com/parallaxsecond/rust-psa-crypto"
links = "mbedcrypto"

[build-dependencies]
bindgen = "0.50.0"
bindgen = "0.54.0"
Copy link
Member

Choose a reason for hiding this comment

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

💯

@@ -162,6 +162,39 @@ impl From<Status> for psa_crypto_sys::psa_status_t {
}
}

#[cfg(feature = "with-mbed-crypto")]
impl From<Error> for psa_crypto_sys::psa_status_t {
Copy link
Member

Choose a reason for hiding this comment

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

If you have this then you don't need to have the whole match again above, in the From<Status> for psa_status_t, you can just do Status::Error(error) => error.into()

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Will push this modification.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! This was actually one of the things that I needed for the ResponseStatus update :)

This commit:
* fixes a bug in build.rs where the shim library was not compiled when
dynamically linking
* add the psa_get_key_id function to the shim
* allow to access psa-crypto-sys from psa-crypto if compiling with Mbed
Crypto
* add a conversion from Error to psa_status_t to avoid going to Status

Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
@hug-dev hug-dev force-pushed the various-improvements branch from 7e15762 to 94bbb52 Compare June 2, 2020 09:19
@hug-dev hug-dev merged commit c81f67a into parallaxsecond:master Jun 2, 2020
@hug-dev hug-dev deleted the various-improvements branch June 2, 2020 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants