-
Notifications
You must be signed in to change notification settings - Fork 59
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
config: Support IPv6 with or without brackets #765
Conversation
248305d
to
6b4d2ee
Compare
keylime/src/crypto.rs
Outdated
let r = CertificateBuilder::new() | ||
.private_key(privkey) | ||
.common_name("uuidB") | ||
.add_ips(vec!["1.2.3.4".to_string()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has 1.2.3.5 address been removed in this call? The idea is to test with more than one IP in the vector. Apart from that, I recommend adding also a test with a list of IPv6 tests, if possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! I moved the unit tests to keylime/crypto/x509.rs
. I also added a test using IPv6 there.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
The CertificateBuilder struct follows the builder pattern to add desired parameters incrementally before generating the certificate. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
The goal of the parser is to support IPv6 addresses to be used in the configuration file with or without brackets. The provided IP addresses are validated using the standard implementation of the IP parser. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
This adds support to use IPv6 in configuraton file with or without brackets. The brackets are removed when the IP is parsed and added back when necessary. This also fix the addition of IPv6 addresses to the mTLS certificate in Subject Alternative Name extension. Fixes: keylime#583 Fixes: keylime#753 Fixes: keylime#755 Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
This adds support for IPv6 addresses in the configuration with or without brackets.
The brackets are removed when the addresses are parsed and then added back when necessary.
This fixes the addition of IPv6 addresses in the mTLS certificate.
This also implements the builder pattern for the certificate generation.
Fixes: #583
Fixes: #753
Fixes: #755