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

Update deps && bump minor version #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "x509-signature"
version = "0.5.0"
version = "0.6.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand All @@ -9,13 +9,13 @@ repository = "https://github.com/paritytech/x509-signature"
keywords = ["X509", "ASN1", "cryptography", "pki"]

[dependencies]
ring = { version = "0.16.15", default-features = false }
ring = { version = "0.16.20", 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 }
w = { package = "webpki", version = "0.21.4", optional = true, default-features = false }
r = { package = "rustls", version = "0.19.1", optional = true }

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

[features]
default = ["rsa"]
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#![forbid(
unconditional_recursion,
unsafe_code,
intra_doc_link_resolution_failure,
broken_intra_doc_links,
while_true,
elided_lifetimes_in_paths
)]
Expand Down Expand Up @@ -296,7 +296,7 @@ impl<'a> X509Certificate<'a> {
}

/// Extracts the algorithm id and public key from a certificate
pub fn parse_certificate<'a>(certificate: &'a [u8]) -> Result<X509Certificate<'a>, Error> {
pub fn parse_certificate(certificate: &[u8]) -> Result<X509Certificate<'_>, Error> {
use core::convert::TryFrom as _;
let das = DataAlgorithmSignature::try_from(certificate)?;
untrusted::Input::from(&*das.inner()).read_all(Error::BadDER, |input| {
Expand Down Expand Up @@ -346,10 +346,10 @@ pub fn parse_certificate<'a>(certificate: &'a [u8]) -> Result<X509Certificate<'a
Ok(X509Certificate {
das,
serial,
subject,
issuer,
not_before,
not_after,
issuer,
subject,
subject_public_key_info,
extensions,
})
Expand Down
2 changes: 1 addition & 1 deletion src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn seconds_from_hms(hour: u8, minute: u8, second: u8) -> Result<u32, Error>
/// * It avoids an unnecessary dependency, and thus prevents bloat.
pub fn days_from_ymd(year: u16, month: u8, day: u8) -> Result<i32, Error> {
const DAYS_IN_MONTH: [u8; 12] = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
if month < 1 || month > 12 || day < 1 {
if !(1..=12).contains(&month) || day < 1 {
return Err(Error::BadDERTime);
}
if if month == 2 {
Expand Down