commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
26b001ca802586459578ebc6d4cfc1163547ebc5
Nathaniel McCallum
2022-03-07T15:37:24
fix(der): export the Newtype derive (#467) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/src/lib.rs b/der/src/lib.rs index 36fd6a5b..a9a470d3 100644 --- a/der/src/lib.rs +++ b/der/src/lib.rs @@ -375,7 +375,7 @@ pub use crypto_bigint as bigint; #[cfg(feature = "derive")] #[cfg_attr(docsrs, doc(cfg(feature = "derive")))] -pub use der_derive::{Choice, Enumerated, Sequence, ValueOrd}; +pub...
1
1
1
9cf287a9e1dc653e4c6d22bdf92a87fb873eee10
Tony Arcieri
2022-03-04T07:57:46
pem-rfc7468: add buffered `Encoder` type (#463)
diff --git a/base64ct/src/encoder.rs b/base64ct/src/encoder.rs index f1fd506c..8df42458 100644 --- a/base64ct/src/encoder.rs +++ b/base64ct/src/encoder.rs @@ -114,15 +114,28 @@ impl<'o, E: Variant> Encoder<'o, E> { Ok(()) } + /// Get the position inside of the output buffer where the write cursor + ...
5
174
108
6998219775045b2872e21485c8b8767236daf1a8
Tony Arcieri
2022-03-03T02:22:15
const-oid: fix comment
diff --git a/const-oid/src/lib.rs b/const-oid/src/lib.rs index 200f5833..26ba7e4e 100644 --- a/const-oid/src/lib.rs +++ b/const-oid/src/lib.rs @@ -68,7 +68,7 @@ pub struct ObjectIdentifier { #[allow(clippy::len_without_is_empty)] impl ObjectIdentifier { /// Maximum size of a BER/DER-encoded OID in bytes. - pu...
1
1
1
8e081831417bdcad674282dce7e666c1bf881b8f
Tony Arcieri
2022-03-02T21:31:23
const-oid: use `Arcs` to validate OID well-formedness (#459) Consolidates the logic in `ObjectIdentifier::from_bytes` and the `Arcs` type, allowing `Arcs` to be used to make a first pass to ensure that an OID is well-formed.
diff --git a/const-oid/src/arcs.rs b/const-oid/src/arcs.rs index 75dae7a9..b3f9f244 100644 --- a/const-oid/src/arcs.rs +++ b/const-oid/src/arcs.rs @@ -22,10 +22,10 @@ pub(crate) const ARC_MAX_FIRST: Arc = 2; pub(crate) const ARC_MAX_SECOND: Arc = 39; /// Maximum number of bytes supported in an arc. -pub(crate) cons...
2
41
56
cae980ce77fe42381a0c059761f51c0fbe491b3f
Tony Arcieri
2022-03-02T15:25:29
base64ct: feature-gated `io::Write` impl for `Encoder` (#457) Allows buffered Base64 encoding using the `io::Write` trait.
diff --git a/base64ct/src/encoder.rs b/base64ct/src/encoder.rs index 4fc7f37c..f1fd506c 100644 --- a/base64ct/src/encoder.rs +++ b/base64ct/src/encoder.rs @@ -8,6 +8,9 @@ use crate::{ }; use core::{cmp, marker::PhantomData, str}; +#[cfg(feature = "std")] +use std::io; + #[cfg(docsrs)] use crate::{Base64, Base64Un...
1
17
0
2ac1e9743e3342f1084b5f34999d0aee147ed9d7
Tony Arcieri
2022-03-02T03:13:42
base64ct: add linewrapping support to `Encoder` (#455) Adds support for buffered incremental Base64 encoding which inserts newline characters at a specified line width. This commit also moves the `LineEnding` type previously defined in `pem-rfc7468` into `base64ct`, and re-exporting it.
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 3a5cf34b..3c0cadab 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -2,9 +2,11 @@ use crate::{ encoding, + line_ending::{CHAR_CR, CHAR_LF}, variant::Variant, Encoding, Error::{self, InvalidLength}, + M...
6
216
83
006c16e083c25a1fbedbdd330c9e2aa9d8d2ebdf
Tony Arcieri
2022-03-01T02:07:44
ssh-key: remove comma from comment
diff --git a/ssh-key/src/authorized_keys.rs b/ssh-key/src/authorized_keys.rs index a8f7b4c8..272e44b3 100644 --- a/ssh-key/src/authorized_keys.rs +++ b/ssh-key/src/authorized_keys.rs @@ -61,7 +61,7 @@ impl<'a> AuthorizedKeys<'a> { loop { let mut line = self.lines.next()?; - // Strip c...
1
1
1
fa22a84b1401836983649de642d2895d6bd0145c
Tony Arcieri
2022-03-01T01:32:05
ssh-key: `authorized_keys::Options` type (#454) Adds a type for modeling the "options" field of the `authorized_keys` file, which parses comma-delimited strings while incorporating basic quoting logic. The `Options` type is an iterator over comma-separated `str` and performs an eager first-pass iteration to ensu...
diff --git a/ssh-key/src/authorized_keys.rs b/ssh-key/src/authorized_keys.rs index 0277f4c5..a8f7b4c8 100644 --- a/ssh-key/src/authorized_keys.rs +++ b/ssh-key/src/authorized_keys.rs @@ -1,6 +1,7 @@ //! Parser for `AuthorizedKeysFile`-formatted data. use crate::{Error, PublicKey, Result}; +use core::fmt; #[cfg(f...
2
177
64
389372d5548080737c41f2b058d8c433bc0f795c
Nathaniel McCallum
2022-02-27T19:07:37
feat: add new Newtype derive (#450) There are a number of der types that could benefit from wrapping in a newtype. For example, `RelativeDistinguishedName` could benefit from an `impl Display` to convert it to a string representation. But because it is just `Vec<AttributeTypeAndValue>` we can't really do this. H...
diff --git a/der/derive/src/lib.rs b/der/derive/src/lib.rs index d9187103..bf0684c7 100644 --- a/der/derive/src/lib.rs +++ b/der/derive/src/lib.rs @@ -120,6 +120,7 @@ mod asn1_type; mod attributes; mod choice; mod enumerated; +mod newtype; mod sequence; mod tag; mod value_ord; @@ -129,6 +130,7 @@ use crate::{ ...
3
167
0
63215be972a3e56d8b9945c73f07a7bc14ad7aa6
Nathaniel McCallum
2022-02-26T01:58:31
fix: impl DecodeValue for AlgorithmIdentifier (#449) This enables AlgorithmIdentifier to be decoded from an Any type. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/spki/src/algorithm.rs b/spki/src/algorithm.rs index 146fe642..8997c4a6 100644 --- a/spki/src/algorithm.rs +++ b/spki/src/algorithm.rs @@ -2,10 +2,8 @@ use crate::{Error, Result}; use core::cmp::Ordering; -use der::{ - asn1::{Any, ObjectIdentifier}, - Decodable, Decoder, DerOrd, Encodable, Sequenc...
1
5
7
03567dc2679230a5149453d84f2f9da6fe010c46
Tony Arcieri
2022-02-25T18:28:40
der: add additional tests for unsigned integer decoding (#448) Covers a noncanonical extra zero as well as a needed missing zero
diff --git a/der/src/asn1/integer/uint.rs b/der/src/asn1/integer/uint.rs index 28fb7ace..e49a02b0 100644 --- a/der/src/asn1/integer/uint.rs +++ b/der/src/asn1/integer/uint.rs @@ -92,6 +92,19 @@ mod tests { assert_eq!(arr, [0x00, 0x00, 0xFF, 0xFE]); } + #[test] + fn decode_to_array_extra_zero() { +...
1
13
0
9d902f034f074d83ea8615ed1eeed785abef4e6b
Tony Arcieri
2022-02-24T21:08:40
der: fix handling of oversized unsigned `INTEGER` inputs (#447) The previous implementation used `saturating_sub` rather than `checked_sub` to compute the number of leading zeroes to use, which would cause a panic if the input exceeded the output (see #446). This commit switches to `checked_sub`, returning `Error...
diff --git a/der/src/asn1/integer/uint.rs b/der/src/asn1/integer/uint.rs index 75948d36..28fb7ace 100644 --- a/der/src/asn1/integer/uint.rs +++ b/der/src/asn1/integer/uint.rs @@ -28,9 +28,14 @@ pub(super) fn decode_to_slice(bytes: &[u8]) -> Result<&[u8]> { pub(super) fn decode_to_array<const N: usize>(bytes: &[u8]) ->...
1
31
2
e0fc1e46af1518c926d38a6a5377c0b6ef2c2a5a
Nathaniel McCallum
2022-02-23T17:40:58
Add AlgorithmIdentifier::oids() helper function (#443) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/spki/src/algorithm.rs b/spki/src/algorithm.rs index b138e507..146fe642 100644 --- a/spki/src/algorithm.rs +++ b/spki/src/algorithm.rs @@ -74,6 +74,26 @@ impl<'a> AlgorithmIdentifier<'a> { pub fn parameters_oid(&self) -> Result<ObjectIdentifier> { Ok(ObjectIdentifier::try_from(self.parameters_...
1
20
0
417f5f85a9ec1f2ecbf9b9272ec7dd87c347390c
Franziskus Kiefer
2022-02-22T07:43:48
tls codec: variable-length vectors (#442) * remove TlsByteVec todo * add QUIC-style variable-length encoding for vectors (std targets only)
diff --git a/tls_codec/Cargo.toml b/tls_codec/Cargo.toml index 16653921..e81abbb6 100644 --- a/tls_codec/Cargo.toml +++ b/tls_codec/Cargo.toml @@ -30,6 +30,10 @@ std = [] name = "tls_vec" harness = false +[[bench]] +name = "quic_vec" +harness = false + [package.metadata.docs.rs] all-features = true rustdoc-args ...
9
550
5
330e0572c86df97966759ab530c76c9fdc0ee133
Tony Arcieri
2022-02-17T15:23:27
x509: factor `GeneralName` tests under `tests/` (#430) An alternative to conditionally gating `std` linkage on `tests` is placing such tests under the `tests/` directory. This commit places the `GeneralName` tests which use `rstest` under the `tests/` directory.
diff --git a/x509/src/ext/pkix/name/general.rs b/x509/src/ext/pkix/name/general.rs index eb779725..3ef393cc 100644 --- a/x509/src/ext/pkix/name/general.rs +++ b/x509/src/ext/pkix/name/general.rs @@ -61,89 +61,3 @@ pub enum GeneralName<'a> { #[asn1(context_specific = "8", tag_mode = "IMPLICIT")] RegisteredId(O...
4
81
90
3058707b064fe61b1ccf812342c509ad5addad3c
Nathaniel McCallum
2022-02-16T16:01:13
Unconditionally specify no_std (#429) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/x509/src/ext/pkix/name/general.rs b/x509/src/ext/pkix/name/general.rs index cc377331..eb779725 100644 --- a/x509/src/ext/pkix/name/general.rs +++ b/x509/src/ext/pkix/name/general.rs @@ -66,6 +66,8 @@ pub enum GeneralName<'a> { mod test { use super::{GeneralName, GeneralNames}; + use std::println...
3
7
2
a04468f5209a77cfe52c3de06451013c4c842040
Nathaniel McCallum
2022-02-12T16:03:52
x509: derive(Sequence) for OtherName (#423) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/x509/src/general_name.rs b/x509/src/general_name.rs index 002132e0..93967268 100644 --- a/x509/src/general_name.rs +++ b/x509/src/general_name.rs @@ -3,44 +3,28 @@ use alloc::string::ToString; use alloc::vec::Vec; use der::asn1::{Any, ContextSpecific, Ia5String, ObjectIdentifier, OctetString}; -use der:...
2
14
43
9c256162d4cccd224283f44a8a0ce20319824306
Nathaniel McCallum
2022-02-11T19:17:21
der+pkcs10+x509: derived `Version` structs (#410) - der: allow `#[asn1(type = "INTEGER")]` on derive(Enumerated) - pkcs10: derive Version - x509: add derived Version enum Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/derive/src/enumerated.rs b/der/derive/src/enumerated.rs index 17d8278d..7067a1bc 100644 --- a/der/derive/src/enumerated.rs +++ b/der/derive/src/enumerated.rs @@ -6,7 +6,7 @@ use crate::ATTR_NAME; use proc_macro2::TokenStream; use proc_macro_error::abort; use quote::quote; -use syn::{DeriveInput, Exp...
6
61
53
46b5507c40501974c667cb1b9dfc15e9a2e5e5aa
Nathaniel McCallum
2022-02-11T18:02:25
der: fix missing format argument (#415) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/derive/src/attributes.rs b/der/derive/src/attributes.rs index f318247e..16842367 100644 --- a/der/derive/src/attributes.rs +++ b/der/derive/src/attributes.rs @@ -331,7 +331,7 @@ impl AttrNameValue { self.value .value() .parse() - ...
1
1
1
b51d331a78bb8355a03fb6fc0557854e916cd579
Nathaniel McCallum
2022-02-11T18:02:16
der: use type's tag by default on derive(Choice) (#416) By default, presume that a choice enum's type implements FixedTag. For many cases, this means that no `#[asn1(...)]` is required at all. In particular, this means that deriving `Choice` for `SEQUENCE` types without a context-specific tag is now possible. Si...
diff --git a/der/derive/src/attributes.rs b/der/derive/src/attributes.rs index e241fe9a..f318247e 100644 --- a/der/derive/src/attributes.rs +++ b/der/derive/src/attributes.rs @@ -277,7 +277,7 @@ impl FieldAttrs { let encoder_obj = ty.encoder(binding); quote!(#encoder_obj.encode...
2
66
12
9ac528187ac823bf106b2eaf5a36216a0dccb958
Nathaniel McCallum
2022-02-11T14:05:08
Use FlagSet to provide an ergonomic experience with flag types (#412) This provides a consistent, ergonomic experience when using flag types. It also removes custom code, replacing it with well tested code. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/Cargo.lock b/Cargo.lock index 9f9b07d7..5dffe744 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -298,6 +298,7 @@ version = "0.6.0-pre.1" dependencies = [ "const-oid", "der_derive", + "flagset", "hex-literal", "pem-rfc7468", "proptest", @@ -349,6 +350,12 @@ dependencies = [ "instant", ] +[[pack...
8
166
225
fdf97d6d7f5f7ad55506b8c13593c355d751be6a
Artyom Pavlov
2022-02-10T20:04:55
Update cipher v0.4 crates (#411)
diff --git a/Cargo.lock b/Cargo.lock index f5261f23..9f9b07d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,14 +4,13 @@ version = 3 [[package]] name = "aes" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed...
3
94
110
f0840c875d39c8cef7e175ed63e36ccafe2a6ab9
Nathaniel McCallum
2022-02-10T17:34:37
Remove the useless default functions (#409) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/x509/src/certificate.rs b/x509/src/certificate.rs index 5fb26955..98b8c711 100644 --- a/x509/src/certificate.rs +++ b/x509/src/certificate.rs @@ -6,21 +6,6 @@ use spki::{AlgorithmIdentifier, SubjectPublicKeyInfo}; use x501::name::Name; use x501::time::Validity; -/// returns false in support of integer ...
3
5
21
e4e00da8586551408f7b2bb40b9c2221ca09bcb1
Tony Arcieri
2022-02-09T23:03:45
base64ct: add `Eq`/`PartialEq` bounds to `Encoding`/`Variant` (#408)
diff --git a/base64ct/src/encoding.rs b/base64ct/src/encoding.rs index d79728fd..63afedbe 100644 --- a/base64ct/src/encoding.rs +++ b/base64ct/src/encoding.rs @@ -16,7 +16,7 @@ const PAD: u8 = b'='; /// /// This trait must be imported to make use of any Base64 variant defined /// in this crate. -pub trait Encoding: ...
6
8
8
89203a6670df216a7fad08c4d3bb72b34595e985
Tony Arcieri
2022-02-09T20:10:37
ssh-key: use `pem-rfc7468` for private key PEM parser (#407) Now that `pem-rfc7468` supports a buffered Base64 decoder (#406), it's possible to use it for parsing PEM-formatted OpenSSH private keys. This commit switches to using `pem-rfc7468` for PEM parsing.
diff --git a/Cargo.lock b/Cargo.lock index f17d2fec..f5261f23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -961,6 +961,7 @@ version = "0.3.0-pre" dependencies = [ "base64ct", "hex-literal", + "pem-rfc7468", "sec1", "zeroize", ] diff --git a/ssh-key/Cargo.toml b/ssh-key/Cargo.toml index f6797ac5..75d53dd4 10064...
6
43
100
cd235189e1e4b8c0debf34178c7acb3f8ee26036
Tony Arcieri
2022-02-09T16:13:46
pem-rfc7468: buffered Base64 decoder (#406) Modifies `pem_rfc7468::Decoder` to be a wrapper around the buffered `base64ct::Decoder` type. This allows incrementally decoding PEM, as opposed to a one-shot approach, however support for one-shot decoding is still preserved as a set of static functions which previous...
diff --git a/pem-rfc7468/Cargo.toml b/pem-rfc7468/Cargo.toml index 173a6b35..fa216df7 100644 --- a/pem-rfc7468/Cargo.toml +++ b/pem-rfc7468/Cargo.toml @@ -21,8 +21,8 @@ rust-version = "1.56" base64ct = { version = "=1.4.0-pre.0", path = "../base64ct" } [features] -alloc = [] -std = ["alloc"] +alloc = ["base64ct/all...
5
139
171
a1f08fd9af15c48f82ea7a171fdabdd439823147
Tony Arcieri
2022-02-09T04:44:56
base64ct: add bounds for `Encoding`/`Variant` ZSTs (#405) Deriving traits like `Copy`, `Clone`, and `Debug` on types which include an encoding as a generic parameter is presently problematic because there are no trait bounds specified. These traits, `Encoding` and the sealed `Variant` which receives a blanket im...
diff --git a/base64ct/src/encoding.rs b/base64ct/src/encoding.rs index 77b6a90f..d79728fd 100644 --- a/base64ct/src/encoding.rs +++ b/base64ct/src/encoding.rs @@ -4,7 +4,7 @@ use crate::{ errors::{Error, InvalidEncodingError, InvalidLengthError}, variant::Variant, }; -use core::str; +use core::{fmt::Debug, s...
6
10
4
560cf106e2a46f22d12d37c649741842b92d6501
Tony Arcieri
2022-02-09T04:18:30
base64ct: impl `std::io::Read` for `Decoder` (#404) Conditionally impls the `Read` trait when the `std` feature is enabled.
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 9a02ae18..3a5cf34b 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -8,6 +8,12 @@ use crate::{ }; use core::{cmp, marker::PhantomData}; +#[cfg(feature = "alloc")] +use {alloc::vec::Vec, core::iter}; + +#[cfg(feature = "std")] ...
3
79
0
cdc9d73293ff81bcd5bbc2673ffcc59af68727c2
Tony Arcieri
2022-02-09T00:34:12
der_derive: expand `ChoiceVariant` lowering tests (#402) Adds a full set of unit tests for deriving context-specific `CHOICE` variants which tests all of the parameters which can be specified via attributes.
diff --git a/der/derive/src/choice/variant.rs b/der/derive/src/choice/variant.rs index 486cdf9f..8e31ca6b 100644 --- a/der/derive/src/choice/variant.rs +++ b/der/derive/src/choice/variant.rs @@ -99,20 +99,17 @@ impl ChoiceVariant { #[cfg(test)] mod tests { use super::ChoiceVariant; - use crate::{Asn1Type, Fie...
1
174
63
b3c3ea1dc3e7e8423c211a38a2da698b72baafde
Tony Arcieri
2022-02-08T23:54:29
der: support `SetOf` sorting on heapless `no_std` targets (#401) Rust's built-in `[T]::sort_by` requires both `alloc` and a panic handler, which is limiting for `no_std` targets. This commit switches to using a heapless-friendly insertion sort implementation which is also fallible and can bubble up errors from `...
diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs index 14198b8d..b9314ad7 100644 --- a/der/src/asn1/set_of.rs +++ b/der/src/asn1/set_of.rs @@ -2,12 +2,12 @@ use crate::{ arrayvec, ord::iter_cmp, ArrayVec, Decodable, DecodeValue, Decoder, DerOrd, Encodable, - EncodeValue, Encoder, ErrorKind, Fixed...
2
152
70
98cabaabfa4437c5e4cfab35ef681e038c19e0a9
Nathaniel McCallum
2022-02-08T23:11:24
Fix length calculation for explicit tags (#400) When deriving `Choice`, the existing macros emit incorrect length calculation code when explicit tags are used. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/derive/src/choice/variant.rs b/der/derive/src/choice/variant.rs index e9841cb9..486cdf9f 100644 --- a/der/derive/src/choice/variant.rs +++ b/der/derive/src/choice/variant.rs @@ -67,8 +67,22 @@ impl ChoiceVariant { /// Derive a match arm for the impl body for `der::EncodeValue::value_len`. pub...
1
16
2
b86d70e8d736f1e53bce1f9c9d5171820edf608d
Tony Arcieri
2022-02-08T22:46:44
der: fix off-by-one error in `ArrayVec::add` (#399) It previously didn't allow adding the last available element in the array, and would return `ErrorKind::Overlength`.
diff --git a/der/src/arrayvec.rs b/der/src/arrayvec.rs index 83b6316b..d5cca23d 100644 --- a/der/src/arrayvec.rs +++ b/der/src/arrayvec.rs @@ -29,7 +29,7 @@ impl<T, const N: usize> ArrayVec<T, N> { /// impl on `T`. pub fn add(&mut self, element: T) -> Result<()> { match self.length.checked_add(1) { -...
1
18
1
bd58b8fbdcbd07d7869ea21e9742ada861ff5413
Nathaniel McCallum
2022-02-08T22:22:39
Add `#[asn1(constructed = "true")]` (#398) This allows for deriving `Choice` over constructed types. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/derive/src/attributes.rs b/der/derive/src/attributes.rs index 73e6c4f3..e241fe9a 100644 --- a/der/derive/src/attributes.rs +++ b/der/derive/src/attributes.rs @@ -78,6 +78,9 @@ pub(crate) struct FieldAttrs { /// Inherits from the type-level tagging mode if specified, or otherwise /// defaults ...
3
31
15
d2a78afd0033523eaf68856d3d7784ec89c5c664
Nathaniel McCallum
2022-02-08T18:19:42
Only emit `.try_into()?` when a type is specified (#397) The purpose of this transformation is for when the caller specifies `type = "..."`. In that case, we decode into the specified type and then convert into actual type. However, in cases where no type is specified, we have to decode into an unspecified type `T`...
diff --git a/der/derive/src/choice/variant.rs b/der/derive/src/choice/variant.rs index eeb5d292..e9841cb9 100644 --- a/der/derive/src/choice/variant.rs +++ b/der/derive/src/choice/variant.rs @@ -47,8 +47,10 @@ impl ChoiceVariant { let tag = self.tag.to_tokens(); let ident = &self.ident; let d...
1
54
4
83b912fd6ff4e4630aa49f9cf8c925094f98ad9e
Tony Arcieri
2022-02-08T17:16:36
der: replace/remove panicking `SetOfVec` APIs (#396) Removes the panicking `From` and `FromIterator` impls on `SetOfVec`, replacing it with a `TryFrom` impl that can gracefully handle sorting errors when using `DerOrd`. Also adds a test for the sorting implementation.
diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs index b2ace05c..14198b8d 100644 --- a/der/src/asn1/set_of.rs +++ b/der/src/asn1/set_of.rs @@ -7,7 +7,7 @@ use crate::{ use core::cmp::Ordering; #[cfg(feature = "alloc")] -use {alloc::vec::Vec, core::slice}; +use {crate::Error, alloc::vec::Vec, core::slice...
2
56
26
1532055d7786b842441002102bc791296ddb17fd
Nathaniel McCallum
2022-02-08T14:05:39
Derive `EncodeValue` for `Choice` (#395) This enables `Choice` values to be used as a field in a `Sequence`. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/derive/src/attributes.rs b/der/derive/src/attributes.rs index aa6f2d3f..73e6c4f3 100644 --- a/der/derive/src/attributes.rs +++ b/der/derive/src/attributes.rs @@ -247,19 +247,28 @@ impl FieldAttrs { } } - /// Get a `der::Encoder` object which respects these field attributes. - pub ...
3
40
31
c144c019ce5c223ac1a738422403d6cc7dd490a6
Nathaniel McCallum
2022-02-07T20:21:27
Choose a better field name for `Attribute` (#394) Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/pkcs10/tests/certreq.rs b/pkcs10/tests/certreq.rs index ca32a706..d3ab85d8 100644 --- a/pkcs10/tests/certreq.rs +++ b/pkcs10/tests/certreq.rs @@ -67,7 +67,7 @@ fn decode_rsa_2048_der() { // Check the attributes (just one; contains extensions). assert_eq!(cr.info.attributes.len(), 1); let att...
2
2
2
035c4ad280e5c3e8cd0e56275bc428dbd6407bb0
Nathaniel McCallum
2022-02-07T17:08:35
Pass `Header` to `DecodeValue` (#392) This makes it possible to implement `DecodeValue` for tagless types such as `CHOICE` and `ANY`. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/der/derive/src/enumerated.rs b/der/derive/src/enumerated.rs index e738af38..17d8278d 100644 --- a/der/derive/src/enumerated.rs +++ b/der/derive/src/enumerated.rs @@ -98,9 +98,9 @@ impl DeriveEnumerated { impl ::der::DecodeValue<'_> for #ident { fn decode_value( ...
31
125
109
33a5d33703e99115f82e67689181c6c4cf560561
Franziskus Kiefer
2022-02-07T09:12:22
tls_codec, tls_codec_derive v0.2.0 (#391)
diff --git a/Cargo.lock b/Cargo.lock index e3bd101f..f17d2fec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,9 +72,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust...
3
59
49
cd16eff7368de8405b770d5e1e49c6384730ee58
Carl Wallace
2022-02-05T20:41:50
x501: add `Display` impl for `Time` (#390)
diff --git a/x501/src/time.rs b/x501/src/time.rs index 3dfa11b6..57857cbe 100644 --- a/x501/src/time.rs +++ b/x501/src/time.rs @@ -1,8 +1,9 @@ //! X.501 time types as defined in RFC 5280 +use core::fmt; use core::time::Duration; use der::asn1::{GeneralizedTime, UtcTime}; -use der::{Choice, Decodable, Error, Result...
1
16
1
3a81c6434a129e40bb22bf986ac9d1ae1e9cbc36
Nathaniel McCallum
2022-02-05T20:25:59
Remove duplicate Attribute types from `pkcs10` (#387) These types are now defined in `x501`. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/pkcs10/src/attribute.rs b/pkcs10/src/attribute.rs deleted file mode 100644 index afc9921a..00000000 --- a/pkcs10/src/attribute.rs +++ /dev/null @@ -1,54 +0,0 @@ -use der::asn1::{Any, ObjectIdentifier, SetOfVec}; -use der::{Decodable, Sequence, ValueOrd}; - -/// PKCS#10 `Attribute` as defined in [RFC 5280 A...
4
3
58
30fb8a9663a02508d6f50b0bb4fe15c3cb4b2a3c
Tony Arcieri
2022-02-05T13:49:25
x501+x509: fix invalid keywords (#386) Keywords are not allowed to contain a `.`
diff --git a/x501/Cargo.toml b/x501/Cargo.toml index 8c49f4b6..d861a5ec 100644 --- a/x501/Cargo.toml +++ b/x501/Cargo.toml @@ -7,7 +7,7 @@ authors = ["RustCrypto Developers"] license = "Apache-2.0 OR MIT" repository = "https://github.com/RustCrypto/formats/tree/master/x509" categories = ["cryptography", "data-struct...
2
2
2
e0bddb4a352720bf861faceddb0fcef8f6c4b84b
Tony Arcieri
2022-02-05T13:32:46
x501 v0.1.0-pre.0 (#385)
diff --git a/Cargo.lock b/Cargo.lock index 69673dfb..e3bd101f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1202,7 +1202,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "x501" -version = "0.0.0" +version = "0.1.0-pre.0" dependencies = [ "der", "hex-literal",...
5
7
7
297950aa2d1a60b5ad74d42bf936627594153ba8
Tony Arcieri
2022-02-04T21:19:58
spki v0.6.0-pre.0 (#384)
diff --git a/Cargo.lock b/Cargo.lock index 4fca63de..69673dfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -938,7 +938,7 @@ dependencies = [ [[package]] name = "spki" -version = "0.6.0-pre" +version = "0.6.0-pre.0" dependencies = [ "base64ct", "der", diff --git a/pkcs10/Cargo.toml b/pkcs10/Cargo.toml index 6e1e...
8
8
8
3a412fa5a88593ab65803b247ac027515502b7a3
Tony Arcieri
2022-02-04T20:30:42
der v0.6.0-pre.1 (#383)
diff --git a/Cargo.lock b/Cargo.lock index 60a55091..4fca63de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "der" -version = "0.6.0-pre.0" +version = "0.6.0-pre.1" dependencies = [ "const-oid", "der_derive", diff --git a/der/Cargo.toml b/der/Cargo.toml index 6...
12
12
12
90ccd7bd93e9b353700b63c663536344d60beaa5
Tony Arcieri
2022-02-04T18:01:22
pem-rfc7468 v0.4.0-pre.0 (#382)
diff --git a/Cargo.lock b/Cargo.lock index 7f8077ca..60a55091 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -515,7 +515,7 @@ dependencies = [ [[package]] name = "pem-rfc7468" -version = "0.4.0-pre" +version = "0.4.0-pre.0" dependencies = [ "base64ct", ] diff --git a/der/Cargo.toml b/der/Cargo.toml index a477dc81....
4
4
4
41b0bbb3a03705f189428f85dfe8df17325f8f61
Tony Arcieri
2022-02-04T17:07:44
base64ct v1.4.0-pre.0 (#381)
diff --git a/Cargo.lock b/Cargo.lock index 9e3ed7f0..7f8077ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.4.0-pre" +version = "1.4.0-pre.0" dependencies = [ "base64", "propte...
6
6
6
a5c01cbeef3c1b76b261267e46e8983a47a16611
Tony Arcieri
2022-02-04T16:36:16
der_derive v0.6.0-pre.1 (#380)
diff --git a/Cargo.lock b/Cargo.lock index d2d76675..9e3ed7f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ dependencies = [ [[package]] name = "der_derive" -version = "0.6.0-pre.0" +version = "0.6.0-pre.1" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/der/Cargo.toml b/der/Car...
3
3
3
1fdf87f6737afb8b73215cfaf3d590a4ae6fcb3a
Tony Arcieri
2022-02-04T16:02:16
pkcs10+x501: bump versions to 0.0.0 (#379) This allows them to be incremented in the release PRs
diff --git a/Cargo.lock b/Cargo.lock index b9ef1f0c..d2d76675 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -532,7 +532,7 @@ dependencies = [ [[package]] name = "pkcs10" -version = "0.1.0" +version = "0.0.0" dependencies = [ "der", "hex-literal", @@ -1202,7 +1202,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a...
6
8
8
dcad322967a18f1c9880e34f8348408c0fa404c3
Franziskus Kiefer
2022-02-02T08:47:33
bump tls_codec and derive to 0.1.0-pre.4 0.1.0 will be published shortly.
diff --git a/Cargo.lock b/Cargo.lock index 5dd86745..cd83946b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1036,7 +1036,7 @@ dependencies = [ [[package]] name = "tls_codec" -version = "0.2.0-pre.3" +version = "0.2.0-pre.4" dependencies = [ "criterion", "serde", @@ -1046,7 +1046,7 @@ dependencies = [ [[packa...
3
5
5
bd904a67785b1b3fb288db215809aa7c824352f4
Tony Arcieri
2022-02-01T19:44:15
der: impl `From`/`FromIterator` for `SetOfVec` (#376) Adds impls of these traits for `SetOfVec`, which sort elements using `DerOrd`. The `FromIterator` impl is composed in terms of the `From<Vec<T>>` impl, which collects the elements into a `Vec`, then sorts them with `sort_by`. One problem is `DerOrd::der_cmp` ...
diff --git a/der/src/asn1/set_of.rs b/der/src/asn1/set_of.rs index bbb9af11..6b650cfd 100644 --- a/der/src/asn1/set_of.rs +++ b/der/src/asn1/set_of.rs @@ -267,6 +267,47 @@ where const TAG: Tag = Tag::Set; } +/// Construct a [`SetOfVec`] from a [`Vec`], sorting the elements using the +/// [`DerOrd`] trait. +/// ...
1
41
0
e65c4aa20a84d6dbd86d9c742f05b54cdcdba162
Tony Arcieri
2022-02-01T17:27:26
der_derive: have `Sequence` macro derive `DecodeValue` (#375) The proc macro previously derived the `Decode` trait, which is not composable with context-specific fields, which depend on the `DecodeValue` trait in order to support IMPLICIT fields. This commit changes the custom derive macro for `Sequence` to produ...
diff --git a/der/derive/src/sequence.rs b/der/derive/src/sequence.rs index 30763491..8cbebc03 100644 --- a/der/derive/src/sequence.rs +++ b/der/derive/src/sequence.rs @@ -84,9 +84,13 @@ impl DeriveSequence { } quote! { - impl<#lt_params> ::der::Decodable<#lifetime> for #ident<#lt_params> ...
1
7
3
8985b92afa5be8ae0f83d1cc1202adc9e2b8557a
Tony Arcieri
2022-02-01T16:50:29
der: add `SequenceRef` type (#374) Adds a type which wraps the value portion / "body" of a DER-serialized `SEQUENCE`. This type subsumes the previous decoding logic for `Decoder::sequence`, parsing the `SEQUENCE` using `DecodeValue` and storing its position within the outer document. In addition to simplifyin...
diff --git a/der/src/asn1.rs b/der/src/asn1.rs index e6d854d7..fd9a753d 100644 --- a/der/src/asn1.rs +++ b/der/src/asn1.rs @@ -33,7 +33,7 @@ pub use self::{ octet_string::OctetString, optional::OptionalRef, printable_string::PrintableString, - sequence::Sequence, + sequence::{Sequence, SequenceRef}...
3
70
39
06a8b11d5ba2c76b8ed81d2919b961de1cb91897
Tony Arcieri
2022-02-01T14:23:38
ssh-key: RSA `PublicKey` encoder support (#373)
diff --git a/ssh-key/src/public.rs b/ssh-key/src/public.rs index 44c47ae4..9481e824 100644 --- a/ssh-key/src/public.rs +++ b/ssh-key/src/public.rs @@ -249,8 +249,8 @@ impl Encode for KeyData { #[cfg(feature = "ecdsa")] Self::Ecdsa(key) => key.encoded_len()?, Self::Ed25519(key) => ...
3
30
5
eca05136881ef0f06763bbce70151eaf4882404e
Tony Arcieri
2022-02-01T14:04:06
ssh-key: DSA `PublicKey` encoder support (#372)
diff --git a/ssh-key/src/mpint.rs b/ssh-key/src/mpint.rs index 2e7c3396..a4c9f07b 100644 --- a/ssh-key/src/mpint.rs +++ b/ssh-key/src/mpint.rs @@ -1,7 +1,7 @@ //! Multiple precision integer use crate::{ - base64::{self, Decode}, + base64::{self, Decode, Encode}, Error, Result, }; use alloc::vec::Vec; @...
4
43
6
3d9a25844c3d066cc56542f59e0672d96b23eaed
Tony Arcieri
2022-02-01T13:12:45
ssh-key: ECDSA `PublicKey` encoder support (#371)
diff --git a/ssh-key/src/algorithm.rs b/ssh-key/src/algorithm.rs index ea58ff57..90a89406 100644 --- a/ssh-key/src/algorithm.rs +++ b/ssh-key/src/algorithm.rs @@ -235,6 +235,16 @@ impl Decode for EcdsaCurve { } } +impl Encode for EcdsaCurve { + fn encoded_len(&self) -> Result<usize> { + Ok(4 + self.as...
4
52
5
c401cfd14938b9411b319db2e3c72f19d1158539
Tony Arcieri
2022-02-01T02:54:06
base64ct: remove encoder loop (#370) A loop is really only necessary for a linewrapped encoder. It can be added back when that feature is implemented, with the logic reflecting the complexities of linewrapping.
diff --git a/base64ct/src/encoder.rs b/base64ct/src/encoder.rs index 75c36ca3..1267d06f 100644 --- a/base64ct/src/encoder.rs +++ b/base64ct/src/encoder.rs @@ -52,27 +52,25 @@ impl<'o, E: Variant> Encoder<'o, E> { /// - `Ok(bytes)` if the expected amount of data was read /// - `Err(Error::InvalidLength)` if th...
1
16
18
9de9e5d5c9a760334d9fb52e8a953ca177bf5462
Tony Arcieri
2022-02-01T02:48:49
ssh-key: initial `PublicKey` encoder w\ Ed25519 support (#369) Adds initial support for encoding `PublicKey` data in OpenSSH format. Uses the new buffered `base64ct::Encoder` type. Ed25519 keys are supported with a `no_std`-friendly profile.
diff --git a/ssh-key/src/algorithm.rs b/ssh-key/src/algorithm.rs index 11739ccb..ea58ff57 100644 --- a/ssh-key/src/algorithm.rs +++ b/ssh-key/src/algorithm.rs @@ -1,7 +1,7 @@ //! Algorithm support. use crate::{ - base64::{self, Decode}, + base64::{self, Decode, Encode}, Error, Result, }; use core::{fmt...
7
239
13
6260f8b2840dbc84bbe19af7fb732cd8da6f943e
Tony Arcieri
2022-01-31T23:26:06
ssh-key: add `FromStr` impls to key types (#368) The `PublicKey` and `PrivateKey` types both have inherent `from_openssh` methods with the goal of potentially supporting some earlier legacy formats in addition to the most current OpenSSH formats. However, they didn't previously have `FromStr`. This commit adds a ...
diff --git a/ssh-key/src/private.rs b/ssh-key/src/private.rs index 23c4d5f7..922e9f07 100644 --- a/ssh-key/src/private.rs +++ b/ssh-key/src/private.rs @@ -26,6 +26,7 @@ use crate::{ base64::{self, Decode}, public, Algorithm, CipherAlg, Error, KdfAlg, KdfOptions, Result, }; +use core::str::FromStr; #[cfg(f...
2
18
0
2db9c84446319c37a329ce8b1e730c402f2b3de9
Tony Arcieri
2022-01-31T15:36:34
der_derive: remove static lifetime from ENUMERATED's derived `DecodeValue` (#367) Closes #296
diff --git a/der/derive/src/enumerated.rs b/der/derive/src/enumerated.rs index 48242dc4..e738af38 100644 --- a/der/derive/src/enumerated.rs +++ b/der/derive/src/enumerated.rs @@ -95,7 +95,7 @@ impl DeriveEnumerated { } quote! { - impl ::der::DecodeValue<'static> for #ident { + ...
1
1
1
fd0aafca27320dfe8223b099d71ec92209e3b425
Tony Arcieri
2022-01-31T14:30:29
base64ct: buffered encoder (#366) Adds a buffered `Encoder` type, similar to the `Decoder` type, which accepts incremental variable-sized binary inputs to encode and incrementally writes Base64 output to a provided buffer. This initial version doesn't yet support linewrapping, but that can be added in a followup...
diff --git a/Cargo.lock b/Cargo.lock index 574c0894..5dd86745 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "base64ct" -version = "1.3.3" +version = "1.4.0-pre" dependencies = [ "base64", "proptest", @...
12
309
82
9ef17cceb150d441a031d8e0e158908a3af83056
Tony Arcieri
2022-01-29T21:55:00
der: impl `ValueOrd` for `SetOf` and `SetOfVec` (#362) Adds impls which make it possible to compare the DER encoded orderings of `SET OF` types.
diff --git a/der/src/arrayvec.rs b/der/src/arrayvec.rs index b8a10907..83b6316b 100644 --- a/der/src/arrayvec.rs +++ b/der/src/arrayvec.rs @@ -121,4 +121,11 @@ impl<'a, T> Iterator for Iter<'a, T> { None } } + + fn size_hint(&self) -> (usize, Option<usize>) { + let len = self.elemen...
4
56
23
85c8550cf2029a6ad3df0ff3994dd196641c32f7
Tony Arcieri
2022-01-29T15:36:01
base64ct: add `unused_qualifications` lint (#361) Enables the lint for unused qualifications, and fixes up the places where they occur. Additionally adds an `unused_lifetimes` lint, but there were no occurances of unused lifetimes that needed correcting. Finally, adds some additional checks and documentation f...
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 796c399d..7d3d5d4d 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -43,7 +43,15 @@ pub struct Decoder<'i, E: Variant> { impl<'i, E: Variant> Decoder<'i, E> { /// Create a new decoder for a byte slice containing contiguous ...
2
27
5
976881ea019ec2b39634c947176e72703748f352
Tony Arcieri
2022-01-28T14:11:27
der: make `OrdIsValueOrd` into sealed trait (#359) While this trait is useful for defining the `ValueOrd` impl for various ASN.1 universal types within the `der` crate itself, it is easily abused outside the context of the `der` crate. `ValueOrd` handles comparing DER serializations for ordering. The `OrdIsValue...
diff --git a/der/src/asn1/boolean.rs b/der/src/asn1/boolean.rs index 79473d0b..da1c6836 100644 --- a/der/src/asn1/boolean.rs +++ b/der/src/asn1/boolean.rs @@ -1,8 +1,8 @@ //! ASN.1 `BOOLEAN` support. use crate::{ - asn1::Any, ByteSlice, DecodeValue, Decoder, EncodeValue, Encoder, Error, ErrorKind, FixedTag, - ...
11
21
23
9828af9d75821244beab5fbe4027719769455d51
Carl Wallace
2022-01-27T23:26:28
add some missing pub declarations (#355) Co-authored-by: Carl Wallace <crwallace1970@gmail.com>
diff --git a/x509/src/pkix_extensions.rs b/x509/src/pkix_extensions.rs index a1cf06c0..be00ff5a 100644 --- a/x509/src/pkix_extensions.rs +++ b/x509/src/pkix_extensions.rs @@ -206,10 +206,10 @@ pub struct PolicyQualifierInfo<'a> { #[derive(Clone, Debug, Eq, PartialEq)] pub struct PrivateKeyUsagePeriod { /// notBe...
1
13
13
96dd1af88075f6406ad429000b24c44521cea7e4
Nathaniel McCallum
2022-01-27T16:50:00
Clean up certificate extension tests (#347) Clippy now complains about the use of a manual counter in the loops. These tests can be more succinctly expressed using `.zip(EXTENSIONS)`. Signed-off-by: Nathaniel McCallum <nathaniel@profian.com>
diff --git a/x509/tests/certificate.rs b/x509/tests/certificate.rs index 3b86df8c..774a1518 100644 --- a/x509/tests/certificate.rs +++ b/x509/tests/certificate.rs @@ -5,6 +5,20 @@ use hex_literal::hex; use x509::Certificate; use x509::*; +// TODO - parse and compare extension values +const EXTENSIONS: &[(&str, bool...
1
21
74
0c416e90a7580a9f60ba7c8c3dcbd8d29703e98a
bstrie
2022-01-25T20:53:26
Implement context-specific tags on #[derive(Sequence)] (#349) This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
diff --git a/der/derive/src/choice/variant.rs b/der/derive/src/choice/variant.rs index 536aa423..cb2639b0 100644 --- a/der/derive/src/choice/variant.rs +++ b/der/derive/src/choice/variant.rs @@ -83,8 +83,9 @@ impl ChoiceVariant { #[cfg(test)] mod tests { use super::ChoiceVariant; - use crate::{Asn1Type, Field...
5
278
29
35f1eb9d3e37782da97d836c6446a34a66474b5d
Tony Arcieri
2022-01-18T14:53:43
der v0.6.0-pre.0 (#345)
diff --git a/Cargo.lock b/Cargo.lock index 998b90a8..58987971 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "der" -version = "0.6.0-pre" +version = "0.6.0-pre.0" dependencies = [ "const-oid", "der_derive", @@ -295,7 +295,7 @@ dependencies = [ [[package]] n...
10
12
12
6facfc4b4b6a8ef4090ad3df853d8b45c63c7c2a
Tony Arcieri
2022-01-18T01:17:46
const-oid: doc improvements (#343)
diff --git a/const-oid/src/arcs.rs b/const-oid/src/arcs.rs index 70debd52..8648b929 100644 --- a/const-oid/src/arcs.rs +++ b/const-oid/src/arcs.rs @@ -3,7 +3,16 @@ use crate::{Error, ObjectIdentifier, Result}; use core::mem; -/// Type used to represent an "arc" (i.e. integer identifier value). +/// Type alias used ...
2
12
4
e9d59bc6bd12dbc06bae2af37469cc2273565f6c
Tony Arcieri
2022-01-17T14:32:33
der_derive: extract `choice::variant` module (#338) Refactors the `choice` module in a similar way to how the `sequence` module was refactored in #337. This makes it easier to extend and test. Additionally, this PR includes an initial set of basic tests for `ChoiceVariant` lowerings.
diff --git a/der/derive/src/attributes.rs b/der/derive/src/attributes.rs index cd92e0cb..aa6f2d3f 100644 --- a/der/derive/src/attributes.rs +++ b/der/derive/src/attributes.rs @@ -14,7 +14,7 @@ pub(crate) const ATTR_NAME: &str = "asn1"; const PARSE_ERR_MSG: &str = "error parsing `asn1` attribute"; /// Attributes on ...
3
131
80
b5ba39f6debcea9c026c99216ea37f688528876d
Tony Arcieri
2022-01-17T01:30:26
der_derive: extract `LowerFieldEncoder` (#337) Similar to #336, this extracts a `LowerFieldEncoder` type along with a `field` module where `SequenceField` is also placed. Additionally it adds some basic tests for the generated code.
diff --git a/der/derive/src/sequence.rs b/der/derive/src/sequence.rs index cc0b9ad9..33df8037 100644 --- a/der/derive/src/sequence.rs +++ b/der/derive/src/sequence.rs @@ -1,11 +1,14 @@ //! Support for deriving the `Sequence` trait on structs for the purposes of //! decoding/encoding ASN.1 `SEQUENCE` types as mapped t...
2
255
149
6a3f59dcdf1aa91f2afdbebfabe0b83493e29102
Tony Arcieri
2022-01-16T23:23:03
der_derive: extract `LowerFieldDecoder` (#336) Extracts an internal stateful `TokenStream` newtype which handles transforming the AST-in-progress. In somewhat handwavy MVC terms, if `DeriveSequence` is the "model", and `SequenceField` the controller, then `LowerFieldDecoder` is the view. This should eventually...
diff --git a/der/derive/src/sequence.rs b/der/derive/src/sequence.rs index 9393b2f5..cc0b9ad9 100644 --- a/der/derive/src/sequence.rs +++ b/der/derive/src/sequence.rs @@ -5,7 +5,7 @@ use crate::{FieldAttrs, TypeAttrs}; use proc_macro2::TokenStream; use proc_macro_error::abort; use quote::quote; -use syn::{DeriveInpu...
1
67
29
ede07531ea957ec0043065fc2dd65f83756aa3c8
Tony Arcieri
2022-01-16T17:42:40
pkcs8: add error conversion support to `pkcs8::spki::Error` (#335) Allows coercing `pkcs8::Error` to `pkcs8::spki::Error` using `?`.
diff --git a/pkcs8/src/error.rs b/pkcs8/src/error.rs index 6fa01508..11498f43 100644 --- a/pkcs8/src/error.rs +++ b/pkcs8/src/error.rs @@ -71,3 +71,13 @@ impl From<spki::Error> for Error { Error::PublicKey(err) } } + +impl From<Error> for spki::Error { + fn from(err: Error) -> spki::Error { + m...
1
10
0
f7e7daa54b21a317a210e969bc546e6139a92c2f
Tony Arcieri
2022-01-16T17:08:16
pkcs1: add error conversion support to `pkcs8::spki::Error` (#333) Allows coercing `pkcs1::Error` to `pkcs8::spki::Error` using `?`. This is useful for decoding PKCS#1-encoded data inside of the `spki` crate's traits.
diff --git a/pkcs1/src/error.rs b/pkcs1/src/error.rs index e89776fc..06cb73ae 100644 --- a/pkcs1/src/error.rs +++ b/pkcs1/src/error.rs @@ -64,6 +64,16 @@ impl From<pkcs8::Error> for Error { } } +#[cfg(feature = "pkcs8")] +impl From<Error> for pkcs8::spki::Error { + fn from(err: Error) -> pkcs8::spki::Error {...
1
10
0
b0b7283a9bc6a3774d4ef3aced70539b63239b8d
Tony Arcieri
2022-01-16T16:39:48
pkcs1: add error conversion support for pkcs8::Error (#331) Allows coercing `pkcs1::Error` to `pkcs8::Error` using `?`. This is useful for decoding PKCS#1-encoded data inside of the `pkcs8` traits.
diff --git a/pkcs1/src/error.rs b/pkcs1/src/error.rs index 6fa86bdf..e89776fc 100644 --- a/pkcs1/src/error.rs +++ b/pkcs1/src/error.rs @@ -46,6 +46,17 @@ impl From<der::Error> for Error { } } +#[cfg(feature = "pkcs8")] +impl From<Error> for pkcs8::Error { + fn from(err: Error) -> pkcs8::Error { + matc...
1
11
0
5565a4dbe695c4ae8dfbc67a627190740ff222a6
Tony Arcieri
2022-01-15T15:19:56
base16ct: add `HexDisplay` type (#329) Adds a `HexDisplay` wrapper type with impls of `Display`, `UpperHex`, and `LowerHex` from `core::fmt` which can be used to display a byte slice using a constant-time hex encoder.
diff --git a/base16ct/src/display.rs b/base16ct/src/display.rs new file mode 100644 index 00000000..1397a91d --- /dev/null +++ b/base16ct/src/display.rs @@ -0,0 +1,35 @@ +use core::fmt; + +/// `core::fmt` presenter for binary data encoded as hexadecimal (Base16). +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub struc...
4
101
32
8b6d58ed45cd7d2a1a7c27d17c85f7b384185992
Artyom Pavlov
2022-01-13T13:18:15
base16ct: add benches (#328)
diff --git a/base16ct/benches/mod.rs b/base16ct/benches/mod.rs new file mode 100644 index 00000000..75af0c9d --- /dev/null +++ b/base16ct/benches/mod.rs @@ -0,0 +1,69 @@ +#![feature(test)] +extern crate test; + +use test::{black_box, Bencher}; + +#[bench] +fn decode_lower(b: &mut Bencher) { + let input = vec![b'1'; ...
1
69
0
bd005fc4a88d4fb527c24b093530b32f3d2f429e
Artyom Pavlov
2022-01-13T01:50:23
pkcs5: update `hmac`, `pbkdf2`, `sha-1`, and `sha2` Updates the following dependencies: - `hmac` => v0.12 - `pbkdf2` => v0.10 - `sha-1` => v0.10 - `sha2` => v0.10 These aren't part of the public API and thus don't require a minor version bump.
diff --git a/Cargo.lock b/Cargo.lock index 609a0a17..10ab24bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,9 +72,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-...
4
111
87
aaf24a4df00e1c8ca9b0985e0e0424c5c217c7a9
Artyom Pavlov
2022-01-13T00:05:20
base16ct: re-organize crate (#325)
diff --git a/base16ct/src/lib.rs b/base16ct/src/lib.rs index 726a0b2e..7fe7cac9 100644 --- a/base16ct/src/lib.rs +++ b/base16ct/src/lib.rs @@ -1,28 +1,57 @@ +//! Pure Rust implementation of Base16 ([RFC 4648], a.k.a. hex). +//! +//! Implements lower and upper case Base16 variants without data-dependent branches +//! or...
5
381
216
e405da0e3f5a71cd941b02225773b8a485ea088d
Tony Arcieri
2022-01-05T22:00:00
spki: add `Error::KeyMalformed` variant (#318) Adds an error variant similar to `pkcs8::Error::KeyMalformed` for relaying that binary data contained in `subject_public_key` is in some way malformed beyond what errors can be communicated via `Error::Asn1` for DER decoding errors. This is useful if DER decoding su...
diff --git a/spki/src/error.rs b/spki/src/error.rs index 9a14dfb5..b19ad6f6 100644 --- a/spki/src/error.rs +++ b/spki/src/error.rs @@ -16,6 +16,12 @@ pub enum Error { /// ASN.1 DER-related errors. Asn1(der::Error), + /// Malformed cryptographic key contained in a SPKI document. + /// + /// This is ...
1
7
0
a40de61c65e27b162f75e0a5d42fb9e0cbdbea80
Tony Arcieri
2021-12-29T23:30:03
ssh-key: `PrivateKey` usage example (#313) Provides an example for how to parse OpenSSH-formatted private keys
diff --git a/ssh-key/src/lib.rs b/ssh-key/src/lib.rs index b5d09a84..bb81e502 100644 --- a/ssh-key/src/lib.rs +++ b/ssh-key/src/lib.rs @@ -11,7 +11,15 @@ //! ## Usage //! -//! ### OpenSSH Public Keys +//! ### Parsing OpenSSH Public Keys +//! +//! OpenSSH-formatted public keys have the form: +//! +//! ```text +//! <...
2
84
20
19b02d1cb5ca5c2855715040166b9bcbb5b83905
Tony Arcieri
2021-12-29T23:15:58
ssh-key: `MPInt` improvements (#312) - Reject unnecessary leading `0` byte - Fix tests to reflect that `from_bytes` does not include length prefix - Add `MPInt::as_positive_bytes` to extract positive numbers
diff --git a/ssh-key/src/mpint.rs b/ssh-key/src/mpint.rs index e74cde25..2e7c3396 100644 --- a/ssh-key/src/mpint.rs +++ b/ssh-key/src/mpint.rs @@ -38,7 +38,7 @@ use zeroize::Zeroize; /// | -deadbeef | `00 00 00 05 ff 21 52 41 11` // TODO(tarcieri): support for heapless platforms, constant time comparisons #[cf...
1
62
10
0d04110257583ef260107bc3311f9d4020a50631
Tony Arcieri
2021-12-29T01:32:34
ssh-key: RSA private key support (#311) Support for decoding RSA private keys into an `RsaKeypair` type. Gated on the `alloc` feature.
diff --git a/ssh-key/src/private.rs b/ssh-key/src/private.rs index 8284ffa4..23c4d5f7 100644 --- a/ssh-key/src/private.rs +++ b/ssh-key/src/private.rs @@ -10,12 +10,17 @@ mod dsa; mod ecdsa; mod ed25519; mod openssh; - #[cfg(feature = "alloc")] -pub use self::dsa::{DsaKeypair, DsaPrivateKey}; +mod rsa; + #[cfg(fea...
11
213
20
49c4ae8ce434d34f2436cb1de01069eb20ac7766
Tony Arcieri
2021-12-28T22:38:07
ssh-key: refactor module structure (#308) Refactors the algorithm-specific modules from the `algorithm` module to per-algorithm modules under `public` and `private`.
diff --git a/ssh-key/src/algorithm.rs b/ssh-key/src/algorithm.rs index 84523602..11739ccb 100644 --- a/ssh-key/src/algorithm.rs +++ b/ssh-key/src/algorithm.rs @@ -1,13 +1,5 @@ //! Algorithm support. -#[cfg(feature = "alloc")] -pub(crate) mod dsa; -#[cfg(feature = "ecdsa")] -pub(crate) mod ecdsa; -pub(crate) mod ed25...
10
248
218
1af785f7dead2118be5a70cbc40fd16a58645557
Tony Arcieri
2021-12-28T22:18:33
ssh-key: DSA private key support (#307) Support for decoding DSA private keys into a `DsaKeypair` type. Gated on the `alloc` feature.
diff --git a/ssh-key/src/algorithm/dsa.rs b/ssh-key/src/algorithm/dsa.rs index c4b86c25..647f63ad 100644 --- a/ssh-key/src/algorithm/dsa.rs +++ b/ssh-key/src/algorithm/dsa.rs @@ -4,30 +4,30 @@ use crate::{ base64::{self, Decode}, MPInt, Result, }; +use core::fmt; +use zeroize::Zeroize; /// Digital Signatu...
7
177
11
a278e3adb1859855b3ba69a0b4cb5f076805aa08
Tony Arcieri
2021-12-28T15:36:41
base64ct: fix potential infinite loop in `Decoder::decode` (#305) A potential infinite loop existed in the event the decoder is asked to decode more data than is available. This commit adds a check for that case which returns `InvalidLength`.
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 975debd3..796c399d 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -122,10 +122,17 @@ impl<'i, E: Variant> Decoder<'i, E> { } if out_pos < out.len() { - // If we still haven't filled the...
1
11
4
a30d9836255d5d52ece9d222c3616d81e42bc970
Tony Arcieri
2021-12-27T15:59:25
ssh-key: `Decode` trait (#303) Adds an internal `Decode` trait which encapsulates the same-shaped `fn decode` method used to decode various types throughout the crate.
diff --git a/ssh-key/src/algorithm.rs b/ssh-key/src/algorithm.rs index 7632e531..84523602 100644 --- a/ssh-key/src/algorithm.rs +++ b/ssh-key/src/algorithm.rs @@ -8,7 +8,10 @@ pub(crate) mod ed25519; #[cfg(feature = "alloc")] pub(crate) mod rsa; -use crate::{base64, Error, Result}; +use crate::{ + base64::{self,...
9
93
54
66c85b02f2ef4de595a39d2f34f1fd42309e249f
Tony Arcieri
2021-12-24T22:51:46
ssh-key: ECDSA private key support (#301) Support for decoding ECDSA private keys into an `EcdsaKeypair` type. Tested against vectors for the NIST P-256, P-384, and P-521 elliptic curves.
diff --git a/ssh-key/Cargo.toml b/ssh-key/Cargo.toml index e3dfb59c..b602b2a6 100644 --- a/ssh-key/Cargo.toml +++ b/ssh-key/Cargo.toml @@ -26,8 +26,9 @@ sec1 = { version = "0.2", optional = true, default-features = false, path = "../ hex-literal = "0.3" [features] -default = ["alloc", "sec1"] +default = ["alloc", "...
11
357
41
b6e2fbc147f6480dcfa46f782a8d145d431f5a22
Tony Arcieri
2021-12-24T20:13:34
base64ct: fix `Decoder` unpadding (#299) Changes from a buggy implementation that tried to eagerly unpad inputs to one which uses the built-in padding support and validation when decoding the final data in a given input message.
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 0aa7385a..4ae1c3e5 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -1,7 +1,6 @@ //! Stateful Base64 decoder. use crate::{ - encoding::decode_padding, variant::Variant, Encoding, Error::{self, InvalidLength},...
2
37
37
3a8d50c1dbde72d7f8fff5012820fcc04ac3a662
Tony Arcieri
2021-12-20T21:36:18
base64ct: rename `Decoder::new_linewrapped` => `::new_wrapped` (#294) This change hasn't been released yet, so renaming is okay and a non-breaking change.
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 00417a66..e87f8ca5 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -57,7 +57,22 @@ impl<'i, E: Variant> Decoder<'i, E> { /// line wraps at the given line length. /// /// Trailing newlines are not supported and must...
1
18
3
34b0bdc216e5f66e71e5bee4ca2ef760a8f08e57
Tony Arcieri
2021-12-20T21:13:45
base64ct: fix `Decoder` handling of multi-line padded Base64 (#293) This fix uses a similar approach of eagerly unpadding the input Base64 used when handling contiguous unwrapped Base64. This is probably a naive strategy though: it's possible that the padding might end up getting split over a newline boundary. ...
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 70fb7202..00417a66 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -45,20 +45,8 @@ impl<'i, E: Variant> Decoder<'i, E> { /// Create a new decoder for a byte slice containing contiguous /// (non-newline-delimited) Base64...
1
78
48
8fe82d3d95f7a43ee04334560b07179d5098d53f
Tony Arcieri
2021-12-20T20:29:39
base64ct: add `Decoder::new_linewrapped` (#292) Adds a mode to the `Decoder` type for decoding Base64 which is wrapped at a specific width. The internal `BlockBuffer` is used to handle Base64 input blocks which are spread across multiple lines, so any line width greater than 0 is supported. This is important bec...
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 1ff029eb..70fb7202 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -6,11 +6,17 @@ use crate::{ Encoding, Error::{self, InvalidLength}, }; -use core::marker::PhantomData; +use core::{cmp, marker::PhantomData}; #[cfg(...
1
241
53
2438e7b67d884cf5c848ee472dada534498cd3de
Tony Arcieri
2021-12-19T18:07:17
spki: impl `ValueOrd` for `AlgorithmIdentifier` (#289) Allows for storing `AlgorithmIdentifier`s in SET OF types. Closes #288
diff --git a/spki/src/algorithm.rs b/spki/src/algorithm.rs index f17bd15b..b138e507 100644 --- a/spki/src/algorithm.rs +++ b/spki/src/algorithm.rs @@ -1,9 +1,10 @@ //! X.509 `AlgorithmIdentifier` use crate::{Error, Result}; +use core::cmp::Ordering; use der::{ asn1::{Any, ObjectIdentifier}, - Decodable, De...
1
11
1
47b142b5cbb49310d452474305f14fb4ca0f8400
Franziskus Kiefer
2021-12-15T06:34:05
tls_codec and tls_codec_derive 0.2.0-pre.3
diff --git a/Cargo.lock b/Cargo.lock index 91823243..3018496c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1021,7 +1021,7 @@ dependencies = [ [[package]] name = "tls_codec" -version = "0.2.0-pre.2" +version = "0.2.0-pre.3" dependencies = [ "criterion", "serde", @@ -1031,7 +1031,7 @@ dependencies = [ [[packa...
3
5
5
099848ca7edf85eb30c3ab8302e7ff696d441e02
stephaneyfx
2021-12-15T06:30:09
Derive `tls_codec` traits for enumerations with data (#265) * Support deriving tls_codec traits for enumerations with data * Add documentation to tls_codec_derive attributes * Warn about how enums are serialized when using the derive macros Co-authored-by: Stephane Raux <sraux@amazon.com>
diff --git a/tls_codec/derive/src/lib.rs b/tls_codec/derive/src/lib.rs index 24b95257..f08ce341 100644 --- a/tls_codec/derive/src/lib.rs +++ b/tls_codec/derive/src/lib.rs @@ -1,16 +1,26 @@ //! # Derive macros for traits in `tls_codec` //! -//! The following attribute is available: +//! ## Warning +//! The derive macr...
3
405
114
ff6d04f260c2db187f0cf70fd6363e9e6c130e37
Tony Arcieri
2021-12-02T22:46:12
base64ct: simplify incremental decoder (#272) Consolidates the `decode_partial` and `decode_exact` methods into a single `decode` method, since that's all that's needed (for now). Makes the `BlockBuffer` persistent which simplifies the implementation somewhat.
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 3fd22e0d..1ff029eb 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -20,12 +20,13 @@ use crate::{Base64, Base64Unpadded}; /// detail of this crate, and leverages a [blanket impl] of [`Encoding`]. /// /// [blanket impl]: ./trait...
3
47
93
59f6bf4f182252d89dfea93fb7a1c547e08ef689
Carl Wallace
2021-12-02T21:44:47
x509: GeneralName (minus x400Address and ediPartyName) and GeneralNames (#271)
diff --git a/x509/src/general_name.rs b/x509/src/general_name.rs new file mode 100644 index 00000000..480e7304 --- /dev/null +++ b/x509/src/general_name.rs @@ -0,0 +1,419 @@ +//! GeneralNames as defined in [RFC 5280 Section 4.2.1.6]. + +use crate::Name; +use alloc::string::ToString; +use alloc::vec::Vec; +use der::asn1...
2
422
1
6a33c5a73b1b7481f5a93ce54e919382c301880e
Tony Arcieri
2021-12-01T15:21:45
base64ct: add padding support to `Decoder` (#267) Adds support for padded variants of Base64 to the stateful `Decoder`
diff --git a/base64ct/src/decoder.rs b/base64ct/src/decoder.rs index 5eec5cdb..4c54c31f 100644 --- a/base64ct/src/decoder.rs +++ b/base64ct/src/decoder.rs @@ -36,6 +36,7 @@ impl<'i, E: Variant> Decoder<'i, E> { /// (non-newline-delimited) Base64-encoded data. pub fn new(input: &'i [u8]) -> Result<Self, Error>...
1
46
13
538748c7e1d633efa51b9aebdb88f1c880a962dc
Stephane Raux
2021-11-29T14:50:50
Implement tls_codec traits for the unit type
diff --git a/tls_codec/src/primitives.rs b/tls_codec/src/primitives.rs index 89f908aa..499e800c 100644 --- a/tls_codec/src/primitives.rs +++ b/tls_codec/src/primitives.rs @@ -190,3 +190,23 @@ where self.0.tls_serialized_len() + self.1.tls_serialized_len() + self.2.tls_serialized_len() } } + +impl Size fo...
1
20
0
caf8d3f85a9e2efe0264b3127e4bd6f9553f8e15
Stephane Raux
2021-11-25T20:56:35
Remove TupleStruct It is not used.
diff --git a/tls_codec/derive/src/lib.rs b/tls_codec/derive/src/lib.rs index 0d89c884..24b95257 100644 --- a/tls_codec/derive/src/lib.rs +++ b/tls_codec/derive/src/lib.rs @@ -46,8 +46,8 @@ use quote::quote; use syn::{ self, parenthesized, parse::{ParseStream, Parser, Result}, - parse_macro_input, Attribut...
1
2
11