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

pki: T6766: Add support for ECDSA private keys #4146

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

sarthurdev
Copy link
Member

@sarthurdev sarthurdev commented Oct 9, 2024

Change Summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

pki

Proposed changes

When validating a private key, if wrapping with default tags fails, try with EC specific tag.

How to test

Setup:

vyos@vyos:~$ openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem
vyos@vyos:~$ cat private-key.pem
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIMyhg2dw/ZUm+JSWbgGiTiwBeU23/z0HlOCY2iAAin0/oAoGCCqGSM49
AwEHoUQDQgAEkW7R7xxUjWfdbp20UJG13BVQM5ocqMEOMNRQ+Yqb6PO7hVe9sEim
UA+A44Q27dosXIYpDVqHRfY4Mtp1Usw7zQ==
-----END EC PRIVATE KEY-----
vyos@vyos:~$ conf
[edit]
vyos@vyos# set pki key-pair TEST private key "MHcCAQEEIMyhg2dw/ZUm+JSWbgGiTiwBeU23z0HlOCY2iAAin0/oAoGCCqGSM49AwEHoUQDQgAEkW7R7xxUjWfdbp20UJG13BVQM5ocqMEOMNRQ+Yqb6PO7hVe9sEimUA+A44Q27dosXIYpDVqHRfY4Mtp1Usw7zQ=="

Before:

vyos@vyos# commit
[ pki ]
Invalid private key on key-pair "TEST"
[[pki]] failed
Commit failed

After:

vyos@vyos# commit
[edit]
vyos@vyos#

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Oct 9, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Oct 9, 2024

CI integration 👍 passed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@dmbaturin dmbaturin merged commit b68c8ce into vyos:current Oct 10, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants