Specify padding scheme with EVP_VerifyFinal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Specify padding scheme with EVP_VerifyFinal

openssl-9
Hello,

I am facing a problem regarding an application which uses EVP_VerifyInit_ex, EVP_VerifyUpdate and EVP_VerifyFinal to verify RSA signatures with EVP_get_digestbyname("RSA-SHA256"). Is it correct that ECP_VerifyFinal defaults to PKCS#1 v1.5 padding?
We would like to be able to switch to other padding algorithms without having to change a lot of code of the application itself. Is it possible to specify a different padding scheme (e.g.

RSA_PKCS1_PSS_PADDING) using this API?
If not, what is the easiest way to work around this "limitation"?

Thank you in advance,
Tom

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Specify padding scheme with EVP_VerifyFinal

Michel

Hi,

 

> Is it possible to specify a different padding scheme (e.g. RSA_PKCS1_PSS_PADDING) using this API ?

> If not, what is the easiest way to work around this "limitation" ?

Isn’t it what you are looking for : EVP_PKEY_CTX_set_rsa_padding() ?

https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_CTX_set_rsa_padding.html

and :

https://wiki.openssl.org/index.php/EVP_Signing_and_Verifying

(OpenSSL version >= 1.0)

 

Hope it helps,

 

Michel.

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Specify padding scheme with EVP_VerifyFinal

openssl-9
Hi Michel,

it looks like what I am looking for, but the software uses EVP_VerifyInit_ex which is a typedef for EVP_DigestInit_ex. How are those functions related to EVP_DigestVerifyInit? Can I use EVP_DigestVerify* functions along with EVP_Verify* functions? I must not break compatibility with the old implementation which needs to support arbitrary MD algorithms.

Thank you for your response!
Tom

Hi,

 

> Is it possible to specify a different padding scheme (e.g. RSA_PKCS1_PSS_PADDING) using this API ?

> If not, what is the easiest way to work around this "limitation" ?

Isn’t it what you are looking for : EVP_PKEY_CTX_set_rsa_padding() ?

https://www.openssl.org/docs/manmaster/man3/EVP_PKEY_CTX_set_rsa_padding.html

and :

https://wiki.openssl.org/index.php/EVP_Signing_and_Verifying

(OpenSSL version >= 1.0)

 

Hope it helps,

 

Michel.

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Specify padding scheme with EVP_VerifyFinal

Dr. Stephen Henson
On Thu, Feb 23, 2017, [hidden email] wrote:

> Hi Michel,
>
> it looks like what I am looking for, but the software uses EVP_VerifyInit_ex which is a typedef for EVP_DigestInit_ex. How are those functions related to EVP_DigestVerifyInit? Can I use EVP_DigestVerify* functions along with EVP_Verify* functions? I must not break compatibility with the old implementation which needs to support arbitrary MD algorithms.
>

You have to use the EVP_Digest* functions if you want to change the RSA
padding mode (or other parameters). This is not supported in the older
EVP_Verify* API.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Loading...