Skip to content

Commit

Permalink
Merge pull request #402 from str4d/update-deps-0.10
Browse files Browse the repository at this point in the history
Update dependencies for 0.10
  • Loading branch information
str4d authored Aug 6, 2023
2 parents bccc4bc + 42c27b0 commit 1d872c9
Show file tree
Hide file tree
Showing 34 changed files with 1,774 additions and 1,527 deletions.
846 changes: 429 additions & 417 deletions Cargo.lock

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,63 @@ members = [
"rage",
]
resolver = "2"

[workspace.package]
authors = ["Jack Grigg <[email protected]>"]
edition = "2021"
rust-version = "1.65"
repository = "https://github.com/str4d/rage"
license = "MIT OR Apache-2.0"

[workspace.dependencies]
age = { version = "0.9.2", path = "age" }
age-core = { version = "0.9.0", path = "age-core" }

# Dependencies required by the age specification:
# - Base64 from RFC 4648
base64 = "0.21"

# - ChaCha20-Poly1305 from RFC 7539
chacha20poly1305 = { version = "0.10", default-features = false, features = ["alloc"] }

# - X25519 from RFC 7748
x25519-dalek = "1"

# - HKDF from RFC 5869 with SHA-256
# - HMAC from RFC 2104 with SHA-256
hkdf = "0.12"
hmac = "0.12"
sha2 = "0.10"

# - scrypt from RFC 7914
scrypt = { version = "0.11", default-features = false }

# - CSPRNG
rand = "0.8"
rand_7 = { package = "rand", version = "0.7" }

# - Key encoding
bech32 = "0.9"

# Parsing
cookie-factory = "0.3.1"
nom = { version = "7", default-features = false, features = ["alloc"] }

# Secret management
pinentry = "0.5"
secrecy = "0.8"
subtle = "2"
zeroize = "1"

# Localization
i18n-embed = { version = "0.13", features = ["fluent-system"] }
i18n-embed-fl = "0.6"
lazy_static = "1"
rust-embed = "6"

# CLI
chrono = "0.4"
console = { version = "0.15", default-features = false }
env_logger = "0.10"
gumdrop = "0.8"
log = "0.4"
5 changes: 5 additions & 0 deletions age-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to Rust's notion of
to 1.0.0 are beta releases.

## [Unreleased]
### Added
- `impl Eq for age_core::format::Stanza`

### Changed
- MSRV is now 1.65.0.

## [0.9.0] - 2022-10-27
### Changed
Expand Down
45 changes: 18 additions & 27 deletions age-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name = "age-core"
description = "[BETA] Common functions used across the age crates"
version = "0.9.0"
authors = ["Jack Grigg <[email protected]>"]
repository = "https://github.com/str4d/rage"
authors.workspace = true
repository.workspace = true
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.59"
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[package.metadata.docs.rs]
all-features = true
Expand All @@ -17,29 +17,20 @@ rustdoc-args = ["--cfg", "docsrs"]
maintenance = { status = "experimental" }

[dependencies]
# Dependencies required by the age specification:
# - Base64 from RFC 4648
base64 = "0.13"

# - ChaCha20-Poly1305 from RFC 7539
chacha20poly1305 = { version = "0.10", default-features = false, features = ["alloc"] }

# - HKDF from RFC 5869 with SHA-256
hkdf = "0.12"
sha2 = "0.10"

# - CSPRNG
rand = "0.8"

# Parsing
cookie-factory = "0.3.1"
nom = { version = "7", default-features = false, features = ["alloc"] }

# Secret management
secrecy = "0.8"

# Plugin backend
# Dependencies exposed in a public API:
# (Breaking upgrades to these require a breaking upgrade to this crate.)
chacha20poly1305.workspace = true
cookie-factory.workspace = true
io_tee = "0.1.1"
nom.workspace = true
secrecy.workspace = true

# Dependencies used internally:
# (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.)
base64.workspace = true
hkdf.workspace = true
rand.workspace = true
sha2.workspace = true
tempfile = { version = "3.2.0", optional = true }

[features]
Expand Down
33 changes: 15 additions & 18 deletions age-core/src/format.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Core types and encoding operations used by the age file format.

use base64::{prelude::BASE64_STANDARD_NO_PAD, Engine};
use rand::{
distributions::{Distribution, Uniform},
thread_rng, RngCore,
Expand Down Expand Up @@ -60,15 +61,15 @@ impl<'a> AgeStanza<'a> {
data[full_chunks.len() * 64..].copy_from_slice(partial_chunk);

// The chunks are guaranteed to contain Base64 characters by construction.
base64::decode_config(&data, base64::STANDARD_NO_PAD).unwrap()
BASE64_STANDARD_NO_PAD.decode(&data).unwrap()
}
}

/// A section of the age header that encapsulates the file key as encrypted to a specific
/// recipient.
///
/// This is the owned type; see [`AgeStanza`] for the reference type.
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub struct Stanza {
/// A tag identifying this stanza type.
pub tag: String,
Expand Down Expand Up @@ -324,6 +325,7 @@ pub mod read {

/// Encoding operations for age types.
pub mod write {
use base64::{prelude::BASE64_STANDARD_NO_PAD, Engine};
use cookie_factory::{
combinator::string,
multi::separated_list,
Expand All @@ -336,7 +338,7 @@ pub mod write {
use super::STANZA_TAG;

fn wrapped_encoded_data<'a, W: 'a + Write>(data: &[u8]) -> impl SerializeFn<W> + 'a {
let encoded = base64::encode_config(data, base64::STANDARD_NO_PAD);
let encoded = BASE64_STANDARD_NO_PAD.encode(data);

move |mut w: WriteContext<W>| {
let mut s = encoded.as_str();
Expand Down Expand Up @@ -377,6 +379,7 @@ pub mod write {

#[cfg(test)]
mod tests {
use base64::{prelude::BASE64_STANDARD_NO_PAD, Engine};
use nom::error::ErrorKind;

use super::{read, write};
Expand All @@ -385,11 +388,9 @@ mod tests {
fn parse_age_stanza() {
let test_tag = "X25519";
let test_args = &["CJM36AHmTbdHSuOQL+NESqyVQE75f2e610iRdLPEN20"];
let test_body = base64::decode_config(
"C3ZAeY64NXS4QFrksLm3EGz+uPRyI0eQsWw7LWbbYig",
base64::STANDARD_NO_PAD,
)
.unwrap();
let test_body = BASE64_STANDARD_NO_PAD
.decode("C3ZAeY64NXS4QFrksLm3EGz+uPRyI0eQsWw7LWbbYig")
.unwrap();

// The only body line is short, so we don't need a trailing empty line.
let test_stanza = "-> X25519 CJM36AHmTbdHSuOQL+NESqyVQE75f2e610iRdLPEN20
Expand Down Expand Up @@ -433,11 +434,9 @@ C3ZAeY64NXS4QFrksLm3EGz+uPRyI0eQsWw7LWbbYig
fn age_stanza_with_full_body() {
let test_tag = "full-body";
let test_args = &["some", "arguments"];
let test_body = base64::decode_config(
"xD7o4VEOu1t7KZQ1gDgq2FPzBEeSRqbnqvQEXdLRYy143BxR6oFxsUUJCRB0ErXA",
base64::STANDARD_NO_PAD,
)
.unwrap();
let test_body = BASE64_STANDARD_NO_PAD
.decode("xD7o4VEOu1t7KZQ1gDgq2FPzBEeSRqbnqvQEXdLRYy143BxR6oFxsUUJCRB0ErXA")
.unwrap();

// The body fills a complete line, so it requires a trailing empty line.
let test_stanza = "-> full-body some arguments
Expand All @@ -460,11 +459,9 @@ xD7o4VEOu1t7KZQ1gDgq2FPzBEeSRqbnqvQEXdLRYy143BxR6oFxsUUJCRB0ErXA
fn age_stanza_with_legacy_full_body() {
let test_tag = "full-body";
let test_args = &["some", "arguments"];
let test_body = base64::decode_config(
"xD7o4VEOu1t7KZQ1gDgq2FPzBEeSRqbnqvQEXdLRYy143BxR6oFxsUUJCRB0ErXA",
base64::STANDARD_NO_PAD,
)
.unwrap();
let test_body = BASE64_STANDARD_NO_PAD
.decode("xD7o4VEOu1t7KZQ1gDgq2FPzBEeSRqbnqvQEXdLRYy143BxR6oFxsUUJCRB0ErXA")
.unwrap();

// The body fills a complete line, but lacks a trailing empty line.
let test_stanza = "-> full-body some arguments
Expand Down
2 changes: 1 addition & 1 deletion age-core/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ mod tests {
pipe.0 = pipe.0.split_off(n_out);
Ok(n_out)
} else {
(&mut buf[..n_in]).copy_from_slice(&pipe.0);
buf[..n_in].copy_from_slice(&pipe.0);
pipe.0.clear();
Ok(n_in)
}
Expand Down
2 changes: 2 additions & 0 deletions age-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to Rust's notion of
to 1.0.0 are beta releases.

## [Unreleased]
### Changed
- MSRV is now 1.65.0.

## [0.4.0] - 2022-10-27
### Changed
Expand Down
25 changes: 15 additions & 10 deletions age-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@
name = "age-plugin"
description = "[BETA] API for writing age plugins."
version = "0.4.0"
authors = ["Jack Grigg <[email protected]>"]
repository = "https://github.com/str4d/rage"
authors.workspace = true
repository.workspace = true
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.59"
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[dependencies]
age-core = { version = "0.9.0", path = "../age-core", features = ["plugin"] }
base64 = "0.13"
bech32 = "0.9"
chrono = "0.4"
# Dependencies exposed in a public API:
# (Breaking upgrades to these require a breaking upgrade to this crate.)
age-core = { workspace = true, features = ["plugin"] }

# Dependencies used internally:
# (Breaking upgrades to these are usually backwards-compatible, but check MSRVs.)
base64.workspace = true
bech32.workspace = true
chrono.workspace = true

[dev-dependencies]
gumdrop = "0.8"
gumdrop.workspace = true

[lib]
bench = false
3 changes: 2 additions & 1 deletion age-plugin/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use age_core::{
plugin::{self, BidirSend, Connection},
secrecy::{ExposeSecret, SecretString},
};
use base64::{prelude::BASE64_STANDARD_NO_PAD, Engine};
use bech32::FromBase32;
use std::collections::HashMap;
use std::io;
Expand Down Expand Up @@ -71,7 +72,7 @@ impl<'a, 'b, R: io::Read, W: io::Write> Callbacks<Error> for BidirCallbacks<'a,
let metadata: Vec<_> = Some(yes_string)
.into_iter()
.chain(no_string)
.map(|s| base64::encode_config(s, base64::STANDARD_NO_PAD))
.map(|s| BASE64_STANDARD_NO_PAD.encode(s))
.collect();
let metadata: Vec<_> = metadata.iter().map(|s| s.as_str()).collect();

Expand Down
3 changes: 2 additions & 1 deletion age-plugin/src/recipient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use age_core::{
plugin::{self, BidirSend, Connection},
secrecy::SecretString,
};
use base64::{prelude::BASE64_STANDARD_NO_PAD, Engine};
use bech32::FromBase32;
use std::io;

Expand Down Expand Up @@ -70,7 +71,7 @@ impl<'a, 'b, R: io::Read, W: io::Write> Callbacks<Error> for BidirCallbacks<'a,
let metadata: Vec<_> = Some(yes_string)
.into_iter()
.chain(no_string)
.map(|s| base64::encode_config(s, base64::STANDARD_NO_PAD))
.map(|s| BASE64_STANDARD_NO_PAD.encode(s))
.collect();
let metadata: Vec<_> = metadata.iter().map(|s| s.as_str()).collect();

Expand Down
6 changes: 6 additions & 0 deletions age/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to Rust's notion of
to 1.0.0 are beta releases.

## [Unreleased]
### Added
- `impl Eq for age::ssh::{ParseRecipientKeyError, UnsupportedKey}`

### Changed
- MSRV is now 1.65.0.
- Migrated to `base64 0.21`, `rsa 0.9`.

## [0.9.2] - 2023-06-12
### Added
Expand Down
Loading

0 comments on commit 1d872c9

Please sign in to comment.