Skip to content
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

Fix RSAPSS salt length check #4

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Fix RSAPSS salt length check #4

merged 1 commit into from
Jan 9, 2024

Conversation

maraino
Copy link

@maraino maraino commented Jan 8, 2024

This commit fixes the salt length check for RSAPSS. The previous logic was only validating rsa.PSSSaltLengthAuto or the length of the digest, e.g., 32 for SHA256. But rsa.PSSSaltLengthEqualsHash was invalid, and this should be equivalent to the length of the digest.

This commit allows using the TLS client handshake with an RSA key because the current logic in Go uses RSAPSS with RSA keys and sets the SaltLenth to rsa.PSSSaltLengthEqualsHash by default. See https://github.com/golang/go/blob/b702e0438ae9577dcc642ba7696a89799c86c8b7/src/crypto/tls/handshake_client_tls13.go#L658-L675

This commit fixes the salt length check for RSAPSS. The previous logic
was only validating rsa.PSSSaltLengthAuto or the length of the digest,
e.g. 32 for SHA256. But rsa.PSSSaltLengthEqualsHash was invalid, and
this should be equivalent to the length of the digest.

This commit allows using the TLS client handshake with an RSA key
because the current logic in Go uses RSAPSS with RSA keys and sets the
SaltLenth to rsa.PSSSaltLengthEqualsHash by default. See
https://github.com/golang/go/blob/b702e0438ae9577dcc642ba7696a89799c86c8b7/src/crypto/tls/handshake_client_tls13.go#L658-L675
@maraino maraino requested a review from hslatman January 8, 2024 23:23
@maraino maraino merged commit 413678f into surrogate Jan 9, 2024
5 of 6 checks passed
@maraino maraino deleted the mariano/pss branch January 9, 2024 18:32
maraino added a commit to smallstep/crypto that referenced this pull request Jan 9, 2024
This commit upgrades smallstep/go-attestation to the last commit in the
surrogate branch. The new version includes a fix for RSAPSS signing from
smallstep/go-attestation#4.
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