Skip to content

openssl_sign()'s new $padding parameter needs to be OPENSSL_PKCS1_PSS_PADDING for PSS padding to work#5420

Open
terrafrost wants to merge 1 commit intophp:masterfrom
terrafrost:terrafrost-patch-1
Open

openssl_sign()'s new $padding parameter needs to be OPENSSL_PKCS1_PSS_PADDING for PSS padding to work#5420
terrafrost wants to merge 1 commit intophp:masterfrom
terrafrost:terrafrost-patch-1

Conversation

@terrafrost
Copy link

Per https://www.php.net/manual/en/function.openssl-sign.php PHP 8.5.0 saw the addition of a new parameter to openssl_sign() - $padding. The documentation says, simply, "RSA PSS padding to use". From that one might think simply setting $padding to 1 would be sufficient but it isn't - it needs to be OPENSSL_PKCS1_PSS_PADDING for PSS signatures to work.

That said, OPENSSL_PKCS1_PSS_PADDING does not appear to be mentioned anywhere else. https://www.php.net/manual/en/openssl.padding.php doesn't seem appropriate because that's "Padding flags for asymmetric encryption". For that I suppose there are two things that could be done. Either that could be renamed "Padding flags" or a whole new page - "Padding flags for signatures" - could be created. I suppose a third option would be to add OPENSSL_PKCS1_PSS_PADDING to https://www.php.net/manual/en/openssl.constants.other.php . That page already has OPENSSL_ZERO_PADDING after all...

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.

1 participant