Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Update rustls dependency
Browse files Browse the repository at this point in the history
This is a breaking change for those who are using the rustls feature, so
the major version has been bumped.
  • Loading branch information
Demi-Marie committed Jul 8, 2020
1 parent de663cc commit 6edfb6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "x509-signature"
version = "0.4.0"
version = "0.5.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
license = "MIT OR Apache-2.0"
description = "Low-level X.509 parsing and signature verification library"
repository = "https://github.com/paritytech/x509-signature"
keywords = ["X509", "ASN1", "cryptography"]
keywords = ["X509", "ASN1", "cryptography", "pki"]

[dependencies]
ring = { version = "0.16.12", default-features = false }
untrusted = "0.7.0"
w = { package = "webpki", version = "0.21.2", optional = true, default-features = false }
r = { package = "rustls", version = "0.17.0", optional = true }
ring = { version = "0.16.15", default-features = false }
untrusted = "0.7.1"
w = { package = "webpki", version = "0.21.3", optional = true, default-features = false }
r = { package = "rustls", version = "0.18.0", optional = true }

[dev-dependencies]
chrono = "0.4.11"
chrono = "0.4.13"

[features]
default = ["rsa"]
Expand Down
13 changes: 0 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,6 @@ pub struct X509Certificate<'a> {
extensions: ExtensionIterator<'a>,
}

#[cfg(any())]
pub fn convert_ymd(time: std::time::SystemTime) -> Result<i64, Error> {
match time.duration_since(std::time::UNIX_EPOCH) {
Ok(d) =>
if d.as_secs() > MAX_ASN1_TIMESTAMP as u64 {
Ok(d.as_secs() as i64)
} else {
Err(Error::BadDERTime)
},
Err(d) => Ok(-(d.duration().as_secs() as i64)),
}
}

impl<'a> X509Certificate<'a> {
/// The tbsCertificate, signatureAlgorithm, and signature
pub fn das(&self) -> DataAlgorithmSignature<'a> { self.das }
Expand Down
3 changes: 1 addition & 2 deletions src/time.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::Error;
use core::convert::TryInto;
use ring::io::der;

/// An ASN.1 timestamp.
Expand Down Expand Up @@ -87,7 +86,7 @@ pub(super) fn read_time(reader: &mut untrusted::Reader<'_>) -> Result<ASN1Time,
let year = collect!(y1, y2);
(if year > 49 { 1900 } else { 2000u16 }) + u16::from(year)
},
(GENERALIZED_TIME, &[y1, y2, y3, y4]) => collect!(y1, y2, y3, y4).try_into().unwrap(),
(GENERALIZED_TIME, &[y1, y2, y3, y4]) => collect!(y1, y2, y3, y4),
_ => return Err(Error::BadDER),
};
Ok(ASN1Time(
Expand Down

0 comments on commit 6edfb6a

Please sign in to comment.