Skip to content

Add RSA-PSS support for handshake #60

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

Merged
merged 16 commits into from
May 16, 2024
Merged

Add RSA-PSS support for handshake #60

merged 16 commits into from
May 16, 2024

Conversation

gowthamsk-arm
Copy link
Collaborator

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

@tgonzalezorlandoarm tgonzalezorlandoarm changed the base branch from main to gsk/handshake_parsec May 15, 2024 16:59
Copy link
Member

@tgonzalezorlandoarm tgonzalezorlandoarm left a comment

Choose a reason for hiding this comment

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

Some comments

pub unsafe extern "C" fn parsec_provider_kmgmt_gettable_params(
_provctx: VOID_PTR,
) -> *const OSSL_PARAM {
println!("In func parsec_provider_kmgmt_GETTABLE_params");

Choose a reason for hiding this comment

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

Could you please remove this print?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Dropped it now.

.map_err(|_| "OSSL_PKEY_PARAM_RSA_E not found".to_string())?;

let mut exp = slice::from_raw_parts(exp_param.data as *const u8, exp_param.data_size).to_vec();
//ToDo: endianess

Choose a reason for hiding this comment

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

ditto with the todo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will fix it.

}
} else {
Ok(OPENSSL_SUCCESS)

Choose a reason for hiding this comment

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

typo: "keys"

PARSEC_PROVIDER_DESCRIPTION_ECDSA
),
pub const PARSEC_PROVIDER_KEYMGMT: [OSSL_ALGORITHM; 2] = [
// ossl_algorithm!(

Choose a reason for hiding this comment

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

Is it necessary to comment it out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will drop this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pushed a new commit as I had removed some const in another commit.

@tgonzalezorlandoarm tgonzalezorlandoarm changed the base branch from gsk/handshake_parsec to main May 15, 2024 17:56
@gowthamsk-arm gowthamsk-arm force-pushed the gsk/rsapss_key branch 3 times, most recently from 5930bf6 to 420b819 Compare May 15, 2024 18:45
@gowthamsk-arm gowthamsk-arm changed the base branch from main to gsk/handshake_parsec May 15, 2024 18:45
Base automatically changed from gsk/handshake_parsec to main May 15, 2024 20:12
This patch adds a openssl support function which finds the desired
param from the param array and sets it withe provided value.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
This is a temporary change. ECDSA support will be added in the
follow-up PRs.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
The RSA component will store the modulus and exponent parts of the
RSA public key in the Provider key object.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
The RSA key from x509 certificates will be loaded using the public
params modulus and exponent. The import function now is capable of
loading RSA public keys.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
The private key and public can only be compared using the public
parts of the RSA key. Only if the match succeeds we can consider
that a public key is related to the corresponding private key.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
We need digest_sign_init() as we need to calculate the digest and
then sign the data. So drop sign_init() in this patch.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
Before, keymgmt match was testing for key names. This does not apply
as what should be compared is the public key content in the TLS
handshake.

Remove that comparison and the corresponding tests.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
@gowthamsk-arm gowthamsk-arm merged commit cef5a43 into main May 16, 2024
@tgonzalezorlandoarm tgonzalezorlandoarm deleted the gsk/rsapss_key branch May 20, 2024 16:02
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.

2 participants