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 support for RSA-PSS #127

Merged
merged 3 commits into from
May 1, 2024
Merged

Conversation

gowthamsk-arm
Copy link
Contributor

Signed-off-by: Gowtham Suresh Kumar gowtham.sureshkumar@arm.com

@tgonzalezorlandoarm
Copy link
Member

I think cargo fmt should be applied here for the CI to pass

@gowthamsk-arm gowthamsk-arm force-pushed the add_pss branch 4 times, most recently from 516f707 to 27de723 Compare May 1, 2024 13:01
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.

Thanks for the patch!

@@ -27,6 +27,10 @@ pub struct CreateRsaKey {
#[structopt(short = 's', long = "for-signing")]
is_for_signing: bool,

/// Supply this flag to create a signing key with PSS scheme and SHA-256 hash algorithm.
Copy link
Member

Choose a reason for hiding this comment

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

You should probably make clear both in the code documentation and in the CLI documentation what the "priority" between these two flags is (this one and the previous).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added comments in the code and also in the CLI about this.

@@ -45,11 +45,13 @@ delete_key() {
create_key() {
# $1 - key type ("RSA" or "ECC")
# $2 - key name
# $3 - key usage ("SIGN" or "OAEP"), only consulted if $1 == "RSA"
# $3 - key usage ("PKCS1_V15", "PSS" or "OAEP"), only consulted if $1 == "RSA"
Copy link
Member

@ionut-arm ionut-arm May 1, 2024

Choose a reason for hiding this comment

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

Be advised, PKCS1 v1.5 is a name for both an encryption and a signature scheme, so you'd need to disambiguate somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shall I rename it to SIGN_PKCS1_V15 and SIGN_PSS?

Copy link
Member

Choose a reason for hiding this comment

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

That works!

@gowthamsk-arm gowthamsk-arm force-pushed the add_pss branch 3 times, most recently from 031d0dc to 4fa8f46 Compare May 1, 2024 13:50
The "-s" option by default creates an RSA signing key with PKCS1 v1.5
scheme. This patch adds a "-p" option to create an RSA with PSS
scheme. Also it enabled CSR creation with PSS keys.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
The newer version of rust clippy fails with "multiple_crate_versions"
error even when src has
"#![allow(clippy::multiple_crate_versions)]"

This is solved by explicity adding the clippy.toml.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
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.

💯

@gowthamsk-arm gowthamsk-arm merged commit 6387589 into parallaxsecond:main May 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants