Skip to content

Conversation

@aarongable
Copy link
Contributor

Add a new check to GoodKey which attempts to factor the public modulus
of the presented key using Fermat's factorization method. This method
will succeed if and only if the prime factors are very close to each
other -- i.e. almost certainly were not selected independently from a
random uniform distribution, but were instead calculated via some other
less secure method.

To support this new feature, add a new config flag to the RA, CA, and
WFE, which all use the GoodKey checks. As part of adding this new config
value, refactor the GoodKey config items into their own config struct
which can be re-used across all services.

If the new FermatRounds config value has not been set, it will default
to zero, causing no factorization to be attempted.

Fixes #5850
Part of #5851

@aarongable aarongable requested a review from a team as a code owner December 14, 2021 00:23
Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Basically looks good to me, just comment fixes and a modest proposal about the return interface (take it or leave it).

@aarongable aarongable requested review from a team and jsha December 14, 2021 01:19
jsha
jsha previously approved these changes Dec 14, 2021
Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Left a nit but it's definitely nonblocking.

jsha
jsha previously approved these changes Dec 14, 2021
@beautifulentropy beautifulentropy self-requested a review December 14, 2021 16:17
@beautifulentropy
Copy link
Member

Looks fantastic!

@aarongable aarongable merged commit 89000bd into main Dec 14, 2021
@aarongable aarongable deleted the ff-check branch December 14, 2021 17:19
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.

Add Fermat factorization to goodkey checks

5 participants