Skip to content

signature: Remove get_signature_len() function #46

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

Closed
wants to merge 1 commit into from

Conversation

gowthamsk-arm
Copy link
Collaborator

The output of psa_sign_hash() gives a vector. We can extract the signature length from this function to handle the corner case when sig is NULL.

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

The output of psa_sign_hash() gives a vector. We can extract
the signature length from this function to handle the corner case
when sig is NULL.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
@tgonzalezorlandoarm
Copy link
Member

I don't think this is applicable.

The signature should not be calculated if this sig is NULL.
This is for various reasons, but one of them is that the sig = NULL case is for obtaining the signature lenght, and then using that length to call sign() again with teh correct signature.
If we were to apply this change, we would be calculating teh signature twice unnnecessarily.

@tgonzalezorlandoarm
Copy link
Member

I also don't think we should be trusting the contents of tbs when sig = NULL,as the user is expecting a signature length and not the signature to be calculated

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