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

testing/certutil: add support to RSA #231

Merged
merged 2 commits into from
Oct 2, 2024
Merged

Conversation

AndersonQ
Copy link
Member

What does this PR do?

Enhance testing/certutil:

  • add support to generate RSA certificates
  • add -rsa cli to generate RSA certificates

Why is it important?

RSA keys are needed to test:

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

How to test

the following should generate RSA keys:

cd testing/certutil/cmd
go run main.go --prefix rsa --pass rsa  --ips 10.80.40.42,127.0.0.1 -name localhost -rsa

verify the certificates with:

openssl x509 -in rsa-localhost.pem -text -noout | grep -E "Algorithm"

        Signature Algorithm: sha256WithRSAEncryption
            Public Key Algorithm: rsaEncryption
    Signature Algorithm: sha256WithRSAEncryption

the keys with:

openssl rsa -in rsa-ca_key.pem -text -noout

Private-Key: (2048 bit, 2 primes)
[...]

Related issues

@AndersonQ AndersonQ added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Sep 27, 2024
@AndersonQ AndersonQ self-assigned this Sep 27, 2024
@AndersonQ AndersonQ requested a review from a team as a code owner September 27, 2024 15:20
@AndersonQ AndersonQ requested review from rdner and VihasMakwana and removed request for a team September 27, 2024 15:20
@AndersonQ AndersonQ requested review from belimawr and removed request for VihasMakwana September 27, 2024 15:25
@AndersonQ AndersonQ marked this pull request as draft September 27, 2024 15:25
@ycombinator ycombinator added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team and removed Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Sep 27, 2024
@AndersonQ AndersonQ marked this pull request as ready for review September 30, 2024 12:49
@AndersonQ
Copy link
Member Author

/test

@AndersonQ AndersonQ force-pushed the certutil-rsa branch 2 times, most recently from 5e9fd64 to 162e7fc Compare September 30, 2024 17:28
* add support to generate RSA certificates
* add `-rsa` cli to generate RSA certificates
* fix CI: use go.elastic.co/go-licence-detector defined on go.mod
Copy link
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

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

LGTM, confirmed that it can generate valid rsa keys.

@AndersonQ
Copy link
Member Author

good catch, it was a leftover from while I was refactoring. Also crypto.PrivateKey is any

@AndersonQ
Copy link
Member Author

/test

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @AndersonQ

@AndersonQ AndersonQ merged commit eb7e16b into elastic:main Oct 2, 2024
3 of 6 checks passed
@AndersonQ AndersonQ deleted the certutil-rsa branch October 2, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants