parallaxsecond / parsec-openssl-provider

Parsec OpenSSL Provider
Apache License 2.0
1 stars 1 forks source link

signature: Remove get_signature_len() function #46

Closed gowthamsk-arm closed 5 months ago

gowthamsk-arm commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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