age: rsa 0.7

This commit is contained in:
Jack Grigg 2022-10-26 08:14:49 +00:00
parent 596877debb
commit 80057188e9
3 changed files with 30 additions and 38 deletions

60
Cargo.lock generated
View file

@ -474,9 +474,9 @@ dependencies = [
[[package]]
name = "const-oid"
version = "0.7.1"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661"
[[package]]
name = "constant_time_eq"
@ -611,16 +611,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "crypto-bigint"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21"
dependencies = [
"generic-array",
"subtle",
]
[[package]]
name = "crypto-common"
version = "0.1.6"
@ -753,13 +743,12 @@ dependencies = [
[[package]]
name = "der"
version = "0.5.1"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f"
dependencies = [
"const-oid",
"crypto-bigint",
"pem-rfc7468",
"zeroize",
]
[[package]]
@ -778,6 +767,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c"
dependencies = [
"block-buffer",
"const-oid",
"crypto-common",
"subtle",
]
@ -1707,15 +1697,6 @@ dependencies = [
"sha2",
]
[[package]]
name = "pem-rfc7468"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30"
dependencies = [
"base64ct",
]
[[package]]
name = "percent-encoding"
version = "2.2.0"
@ -1770,24 +1751,24 @@ dependencies = [
[[package]]
name = "pkcs1"
version = "0.3.3"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320"
checksum = "eff33bdbdfc54cc98a2eca766ebdec3e1b8fb7387523d5c9c9a2891da856f719"
dependencies = [
"der",
"pkcs8",
"spki",
"zeroize",
]
[[package]]
name = "pkcs8"
version = "0.8.0"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba"
dependencies = [
"der",
"spki",
"zeroize",
]
[[package]]
@ -2129,9 +2110,9 @@ dependencies = [
[[package]]
name = "rsa"
version = "0.6.1"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b"
checksum = "96144aaefe4fa4c1846c404d1ccc3dc45c9b15c2e41591597294cb7ccc2dbfd7"
dependencies = [
"byteorder",
"digest 0.10.5",
@ -2142,6 +2123,7 @@ dependencies = [
"pkcs1",
"pkcs8",
"rand_core 0.6.4",
"signature",
"smallvec",
"subtle",
"zeroize",
@ -2319,6 +2301,16 @@ dependencies = [
"digest 0.10.5",
]
[[package]]
name = "signature"
version = "1.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c"
dependencies = [
"digest 0.10.5",
"rand_core 0.6.4",
]
[[package]]
name = "slab"
version = "0.4.7"
@ -2342,9 +2334,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spki"
version = "0.5.4"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27"
checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b"
dependencies = [
"base64ct",
"der",

View file

@ -46,7 +46,7 @@ bech32 = "0.9"
# OpenSSH-specific dependencies:
# - RSAES-OAEP from RFC 8017 with SHA-256 and MGF1
num-traits = { version = "0.2", optional = true }
rsa = { version = "0.6", optional = true }
rsa = { version = "0.7", default-features = false, optional = true }
# - Conversion of public keys from Ed25519 to X25519
curve25519-dalek = { version = "3", optional = true }

View file

@ -162,7 +162,7 @@ mod decrypt {
mod read_asn1 {
use nom::{
bytes::complete::{tag, take},
combinator::{map, map_opt},
combinator::{map, map_opt, map_res},
error::{make_error, ErrorKind},
multi::{length_data, length_value},
sequence::{preceded, terminated, tuple},
@ -261,7 +261,7 @@ mod read_asn1 {
preceded(
tag_version(0),
terminated(
map(
map_res(
tuple((integer, integer, integer, integer, integer)),
|(n, e, d, p, q)| {
rsa::RsaPrivateKey::from_components(n, e, d, vec![p, q])
@ -418,7 +418,7 @@ mod read_ssh {
fn openssh_rsa_privkey(input: &[u8]) -> IResult<&[u8], rsa::RsaPrivateKey> {
delimited(
string_tag(SSH_RSA_KEY_PREFIX),
map(
map_res(
tuple((mpint, mpint, mpint, mpint, mpint, mpint)),
|(n, e, d, _iqmp, p, q)| rsa::RsaPrivateKey::from_components(n, e, d, vec![p, q]),
),