Skip to content

RSA PSS OpenSSL compatibility verification: support AUTO#6938

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:rsa_pss_salt_len_openssl_compat_fix
Nov 2, 2023
Merged

RSA PSS OpenSSL compatibility verification: support AUTO#6938
dgarske merged 1 commit intowolfSSL:masterfrom
SparkiDev:rsa_pss_salt_len_openssl_compat_fix

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

@SparkiDev SparkiDev commented Nov 1, 2023

Description

When wolfSSL_RSA_verify_PKCS1_PSS() called with RSA_PSS_SALTLEN_AUTO (RSA_PSS_SALTLEN_MAX_SIGN) it wasn't using RSA_PSS_SALT_LEN_DISCOVER when available. ZD 16897

Testing

PoC

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev SparkiDev self-assigned this Nov 1, 2023
Comment thread src/pk.c Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps the #else case should return an error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No case now when WOLFSSL_PSS_SALT_LEN_DISCOVER not defined.
Will go to default which errors out on negative.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd really like a test case for this... Could we add one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually that doesn't work.
-2 is RSA_PSS_SALTLEN_MAX_SIGN for signing and using -2 should have the same semantics in verify.
Discovery will handle anything.

@SparkiDev SparkiDev force-pushed the rsa_pss_salt_len_openssl_compat_fix branch from 6d06322 to e766b5b Compare November 2, 2023 00:33
dgarske
dgarske previously approved these changes Nov 2, 2023
When wolfSSL_RSA_verify_PKCS1_PSS() called with RSA_PSS_SALTLEN_AUTO
(RSA_PSS_SALTLEN_MAX_SIGN) it wasn't using RSA_PSS_SALT_LEN_DISCOVER
when available.
@SparkiDev SparkiDev force-pushed the rsa_pss_salt_len_openssl_compat_fix branch from e766b5b to 4870435 Compare November 2, 2023 01:24
@SparkiDev SparkiDev assigned dgarske and wolfSSL-Bot and unassigned SparkiDev Nov 2, 2023
Copy link
Copy Markdown
Member

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Confirmed fix works. Required adding -DWOLFSSL_PSS_SALT_LEN_DISCOVER to wolfSSL build options.

@dgarske dgarske merged commit 8fc7545 into wolfSSL:master Nov 2, 2023
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.

3 participants