Skip to content

Commit

Permalink
Refactor repository and CA code to support BGPsec CSRs. (#210)
Browse files Browse the repository at this point in the history
This commit refactors the library to support BGPsec CSRs and creating
router certificates from them.

In particular, it:

* moves `repository::crypto` into its own top-level module and adds the
  `crypto` feature,
* adds separate signature algorithm types for RPKI and BGPsec and adds a
  `SignatureAlgorithm` trait so the two can be used in parallel,
* makes `crypto::signature::Signature` generic over the signature algorithm,
* changes the `Signer` trait and soft-signer implementation to be able to
  deal with both signature algorithm types via an intermediary
  `SigningAlgorithm` enum,
* makes `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,
* moves `repository::oid` into its own top-level module and makes it depend
  on the `bcder` feature,
* moves `repository::csr` to `ca::csr` where it belongs,
* changes the `ca::csr`’s types to be generic over the signature algorithms
  and CSR attributes,
* changes the type of the Extended Key Usage attribute of certificates and
  CSRs into a newtype around the wrapping capture, and
* adds missing functionality to `TbsCert` and `CertBuilder` to be able to
  generate router certificates.

This is a breaking change.
  • Loading branch information
partim authored Jun 16, 2022
1 parent f7de121 commit b21879e
Show file tree
Hide file tree
Showing 27 changed files with 745 additions and 743 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rpki"
version = "0.14.3-dev"
version = "0.15.0-dev"
edition = "2018"
authors = ["The NLnet Labs RPKI Team <[email protected]>"]
description = "A library for validating and creating RPKI data."
Expand Down Expand Up @@ -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" ]
rrdp = [ "xml", "ring" ]
rtr = [ "futures-util", "tokio", "tokio-stream" ]
slurm = [ "serde-support", "serde_json" ]
Expand All @@ -62,7 +63,7 @@ extra-debug = [ "bcder/extra-debug" ]

# Dummy features for Windows CI runs where we don’t want to have to deal
# with OpenSSL
__windows_ci_all = [ "repository", "rrdp", "rtr", "serde-support", "extra-debug" ]
__windows_ci_all = [ "ca", "rrdp", "rtr", "serde-support", "extra-debug" ]

[[bin]]
name = "readcer"
Expand Down
Loading

0 comments on commit b21879e

Please sign in to comment.