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 missing RSA 3072 bit key size #536

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

inteon
Copy link
Contributor

@inteon inteon commented Oct 25, 2024

This causes the .ValidateCertificateRequest() validation function to fail for 3072 bit RSA keys.

@luispresuelVenafi
Copy link
Contributor

Hi @inteon ,
change looks good, but it is still pending to have testing

@@ -1981,7 +1981,7 @@ func TestReadPolicyConfiguration(t *testing.T) {
[]string{".*"},
[]string{".*"},
[]endpoint.AllowedKeyConfiguration{
{certificate.KeyTypeRSA, certificate.AllSupportedKeySizes(), nil},
{certificate.KeyTypeRSA, []int{1024, 2048, 3072, 4096, 8192}, nil},
Copy link
Contributor

@luispresuelVenafi luispresuelVenafi Nov 5, 2024

Choose a reason for hiding this comment

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

Could you revert this, as it was better set as it was before. Also I have question. Is this size allowed in TPP 22.3? If not, we will need to upgrade, since running test got the following:

        get:    {SubjectCNRegexes:[^([\p{L}\p{N}-*]+\.)*vfidev\.com$ ^([\p{L}\p{N}-*]+\.)*vfidev\.net$ ^([\p{L}\p{N}-*]+\.)*vfide\.org$] SubjectORegexes:[^Venafi Inc\.$] SubjectOURegexes:[^Integration$] SubjectSTRegexes:[^Utah$] SubjectLRegexes:[^Salt Lake$] SubjectCRegexes:[^US$] AllowedKeyConfigurations:[{KeyType:0 KeySizes:[2048 3072 4096 8192] KeyCurves:[]}] DnsSanRegExs:[^([\p{L}\p{N}-*]+\.)*vfidev\.com$ ^([\p{L}\p{N}-*]+\.)*vfidev\.net$ ^([\p{L}\p{N}-*]+\.)*vfide\.org$] IpSanRegExs:[.*] EmailSanRegExs:[.*] UriSanRegExs:[.*] UpnSanRegExs:[.*] AllowWildcards:true AllowKeyReuse:true} 
        expect: {SubjectCNRegexes:[^([\p{L}\p{N}-*]+\.)*vfidev\.com$ ^([\p{L}\p{N}-*]+\.)*vfidev\.net$ ^([\p{L}\p{N}-*]+\.)*vfide\.org$] SubjectORegexes:[^Venafi Inc\.$] SubjectOURegexes:[^Integration$] SubjectSTRegexes:[^Utah$] SubjectLRegexes:[^Salt Lake$] SubjectCRegexes:[^US$] AllowedKeyConfigurations:[{KeyType:0 KeySizes:[2048 4096 8192] KeyCurves:[]}] DnsSanRegExs:[^([\p{L}\p{N}-*]+\.)*vfidev\.com$ ^([\p{L}\p{N}-*]+\.)*vfidev\.net$ ^([\p{L}\p{N}-*]+\.)*vfide\.org$] IpSanRegExs:[.*] EmailSanRegExs:[.*] UriSanRegExs:[.*] UpnSanRegExs:[.*] AllowWildcards:true AllowKeyReuse:true}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted the change and fixed the failing test.

@inteon inteon force-pushed the add_3072_RSA_keysize branch from 769cb1a to 330b56a Compare November 5, 2024 18:21
@luispresuelVenafi luispresuelVenafi self-requested a review November 5, 2024 21:52
Copy link
Contributor

@luispresuelVenafi luispresuelVenafi left a comment

Choose a reason for hiding this comment

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

There's pending to fix the following:

[2024-11-05T19:23:20.684Z] === RUN   TestConvertServerPolicyToInternalPolicy
[2024-11-05T19:23:20.684Z]     tpp_test.go:315: bad key lengths
[2024-11-05T19:23:20.684Z] --- FAIL: TestConvertServerPolicyToInternalPolicy (0.00s)

@inteon inteon requested a review from tr1ck3r as a code owner November 21, 2024 14:59
@inteon
Copy link
Contributor Author

inteon commented Nov 21, 2024

There's pending to fix the following:

[2024-11-05T19:23:20.684Z] === RUN   TestConvertServerPolicyToInternalPolicy
[2024-11-05T19:23:20.684Z]     tpp_test.go:315: bad key lengths
[2024-11-05T19:23:20.684Z] --- FAIL: TestConvertServerPolicyToInternalPolicy (0.00s)

Thank you for letting me know. I updated the test such that it succeeds. I think that CI testing would be very helpful for this project, it would drastically reduce the time necessary to find and fix these test issues.

@luispresuelVenafi
Copy link
Contributor

luispresuelVenafi commented Nov 21, 2024

Hi @inteon your changes looked good in our pipeline. I tried to merge but I couldn't since your commits aren't signed (just noticed that, wish I could tell you sooner):

image

It is a requirement to merge changes into our Open Source repositories, for security purposes:

image

You can learn more about signing commits here:

https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification

@inteon inteon force-pushed the add_3072_RSA_keysize branch from 5487cd3 to 79d4b5f Compare November 25, 2024 09:43
@inteon
Copy link
Contributor Author

inteon commented Dec 10, 2024

@luispresuelVenafi All commits are signed now.

@luispresuelVenafi luispresuelVenafi merged commit dbcec10 into Venafi:master Dec 11, 2024
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