-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactor repository and CA code to support BGPsec CSRs. #210
Conversation
I did not look at the code yet. Or well I did not give it a good look yet. But I have made krill branch that depends on this and after some sweat and tears that now works with these updates. I did not yet get to the point of trying to sign BGPSec Router Certificates - but all the other stuff still works. |
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. I now want to try to create a BGPSec Router Certificate from Krill code. Then again, perhaps it's best to look at any changes needed (if any) for that as a separate PR.
@@ -43,7 +43,8 @@ default = [] | |||
|
|||
# Main components of the crate. | |||
ca = [ "repository", "serde-support" ] | |||
repository = [ "bcder", "ring", "untrusted", "routecore/bcder" ] | |||
crypto = [ "bcder", "ring", "untrusted" ] | |||
repository = [ "bcder", "crypto", "routecore/bcder" ] |
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.
If repository
includes crypto
does it still need bcder
? Also, I am not sure why it needs both bcder
and routecore/bcder
- though that is not related to this PR.
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.
Hm, I wonder if we can make repository
not require crypto
.
I’m not sure if enabling bcder
here also enables it for routecore
, so I decided to play it safe. This all is going to change eventually with the new way of dealing with features and dependencies stablised in a recent Rust release, but I don’t want to jump MSRVs too quickly.
BGPsec CSRs are signed using ECDSA keys rather than the usual RSA. Supporting this requires a slew of changes to the
repository
andca
modules.This PR
repository::crypto
into its own top-level module and adds thecrypto
feature,SignatureAlgorithm
trait so the two can be used in parallel,crypto::signature::Signature
generic over the signature algorithm,Signer
trait and soft-signer implementation to be able to deal with both signature algorithm types via an intermediarySigningAlgorithm
enum,repository::x509::SignedData
(the type used for the outer, signed portion of certificates, CRLs, and CSRs) generic over the signature algorithm type so it can be used for both RPKI and BGPsec objects,repository::oid
into its own top-level module and makes it depend on thebcder
feature,repository::csr
toca::csr
where it belongs,ca::csr
’s types to be generic over the signature algorithms and CSR attributes,TbsCert
andCertBuilder
to be able to generate router certificates, and