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

add salt length calculation with PSSSaltLengthAuto #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maraino
Copy link
Contributor

@maraino maraino commented Jul 13, 2022

Description

This PR adds support for signing using rsa.PSSSaltLengthAuto

When PSSSaltLengthAuto is set, the maximum salt length must equal:

(modulus_key_size - 1 + 7)/8 - hash_length - 2

For example, for a 4096-bit modules key and SHA256 it should be:

(4096 - 1 + 7)/8 - 32 - 2 = 478

See https://golang.org/cl/302230

When PSSSaltLengthAuto is set, the maximum salt length must equal:

  (modulus_key_size - 1 + 7)/8 - hash_length - 2

For example, for a 4096-bit modules key and SHA256 it should be:

  (4096 - 1 + 7)/8 - 32 - 2 = 478

See https://golang.org/cl/302230
@maraino maraino changed the title fix salt length calculation with PSSSaltLengthAuto add salt length calculation with PSSSaltLengthAuto Jul 13, 2022
@maraino
Copy link
Contributor Author

maraino commented Aug 12, 2022

@solcates, are you maintaining this repo? Any updates on this?

Copy link
Contributor

@optnfast optnfast left a comment

Choose a reason for hiding this comment

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

The change looks good to me.

@maraino
Copy link
Contributor Author

maraino commented Nov 11, 2022

@optnfast do you know who has approving rights in this repo and can merge this? @solcates?

@optnfast
Copy link
Contributor

@solcates would be my first thought but I no longer work for Thales so I don't really know.

Copy link
Contributor

@solcates solcates left a comment

Choose a reason for hiding this comment

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

Sorry, I haven't been checking up on this code like I should have

LGTM

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