Skip to content

Commit

Permalink
Update dependencies and code to allow using rpki-rs 0.18.0 (#1166)
Browse files Browse the repository at this point in the history
* Update rpki-rs, backoff, tokio_rustls, and include rustls_pemfile
* Clean up extern crate statements
  • Loading branch information
Tim Bruijnzeels authored Nov 30, 2023
1 parent 0c0666f commit d1177d3
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 84 deletions.
115 changes: 76 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exclude = [
]

[dependencies]
backoff = { version = "0.3.0", optional = true }
backoff = { version = "0.4.0", optional = true }
base64 = "^0.13"
basic-cookies = { version = "^0.1", optional = true }
bytes = "1"
Expand Down Expand Up @@ -57,8 +57,12 @@ regex = { version = "1.5.5", optional = true, default_features = false, features
] }
reqwest = { version = "0.11", features = ["json"] }
rpassword = { version = "^5.0", optional = true }
rpki = { version = "0.17.2", features = ["ca", "compat", "rrdp"] }
# rpki = { version = "0.16.0-dev", git = "https://github.com/nLnetLabs/rpki-rs", branch = "csr-ca-repo-trailing-slash", features = [ "ca", "compat", "rrdp" ] }
rpki = { version = "0.18.0", features = ["ca", "compat", "rrdp"] }
# rpki = { version = "0.17.3-dev", git = "https://github.com/nLnetLabs/rpki-rs", branch = "ring-0.17", features = [
# "ca",
# "compat",
# "rrdp",
# ] }
scrypt = { version = "^0.6", optional = true, default-features = false }
serde = { version = "^1.0", features = ["derive", "rc"] }
serde_json = "^1.0"
Expand All @@ -69,7 +73,8 @@ tokio = { version = "1", features = [
"signal",
"time",
] }
tokio-rustls = "^0.22"
tokio-rustls = "0.24.1"
rustls-pemfile = "1.0.4" # needed to parse pem files for use in our HTTPS listener
toml = "^0.5"
unicode-normalization = { version = "^0.1", optional = true }
url = { version = "2.3.1", features = ["serde"] }
Expand Down
4 changes: 2 additions & 2 deletions src/commons/crypto/signing/signers/kmip/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ impl From<backoff::Error<SignerError>> for SignerError {
fn from(err: backoff::Error<SignerError>) -> Self {
match err {
backoff::Error::Permanent(err) => err,
backoff::Error::Transient(err) => err,
backoff::Error::Transient { err, .. } => err,
}
}
}
Expand All @@ -961,7 +961,7 @@ where
E: From<kmip::client::Error>,
{
if err.is_connection_error() {
backoff::Error::Transient(err.into())
backoff::Error::transient(err.into())
} else {
backoff::Error::Permanent(err.into())
}
Expand Down
6 changes: 3 additions & 3 deletions src/commons/crypto/signing/signers/pkcs11/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,22 +1148,22 @@ impl From<backoff::Error<InternalConnError>> for InternalConnError {
fn from(v: backoff::Error<InternalConnError>) -> Self {
match v {
backoff::Error::Permanent(err) => err,
backoff::Error::Transient(err) => err,
backoff::Error::Transient { err, .. } => err,
}
}
}

fn retry_on_transient_pkcs11_error(err: Pkcs11Error) -> backoff::Error<InternalConnError> {
if is_transient_error(&err) {
backoff::Error::Transient(err.into())
backoff::Error::transient(err.into())
} else {
backoff::Error::Permanent(err.into())
}
}

fn retry_on_transient_signer_error(err: SignerError) -> backoff::Error<InternalConnError> {
match err {
SignerError::TemporarilyUnavailable => backoff::Error::Transient(err.into()),
SignerError::TemporarilyUnavailable => backoff::Error::transient(err.into()),
_ => backoff::Error::Permanent(err.into()),
}
}
Expand Down
Loading

0 comments on commit d1177d3

Please sign in to comment.