feat: update example ssh agent
This commit is contained in:
64
Cargo.lock
generated
64
Cargo.lock
generated
@@ -407,7 +407,6 @@ dependencies = [
|
|||||||
"sha2 0.10.2",
|
"sha2 0.10.2",
|
||||||
"simpledateformat",
|
"simpledateformat",
|
||||||
"ssh-agent",
|
"ssh-agent",
|
||||||
"ssh-key",
|
|
||||||
"u2f",
|
"u2f",
|
||||||
"x509",
|
"x509",
|
||||||
"x509-parser 0.13.1",
|
"x509-parser 0.13.1",
|
||||||
@@ -507,12 +506,6 @@ version = "0.6.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b"
|
checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "const-oid"
|
|
||||||
version = "0.7.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cookie-factory"
|
name = "cookie-factory"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
@@ -661,19 +654,10 @@ version = "0.4.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4"
|
checksum = "79b71cca7d95d7681a4b3b9cdf63c8dbc3730d0584c2c74e31416d64a90493f4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const-oid 0.6.2",
|
"const-oid",
|
||||||
"crypto-bigint",
|
"crypto-bigint",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "der"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
|
|
||||||
dependencies = [
|
|
||||||
"const-oid 0.7.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "der-oid-macro"
|
name = "der-oid-macro"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
@@ -824,7 +808,7 @@ version = "0.12.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372"
|
checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"der",
|
||||||
"elliptic-curve",
|
"elliptic-curve",
|
||||||
"hmac",
|
"hmac",
|
||||||
"signature",
|
"signature",
|
||||||
@@ -1951,15 +1935,6 @@ dependencies = [
|
|||||||
"base64ct",
|
"base64ct",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pem-rfc7468"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "973e070439aaacda48e5effad187f36d670b7635f7dcb75fa3c6f482d1b5b932"
|
|
||||||
dependencies = [
|
|
||||||
"base64ct",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "petgraph"
|
name = "petgraph"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@@ -2003,8 +1978,8 @@ version = "0.2.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "116bee8279d783c0cf370efa1a94632f2108e5ef0bb32df31f051647810a4e2c"
|
checksum = "116bee8279d783c0cf370efa1a94632f2108e5ef0bb32df31f051647810a4e2c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"der",
|
||||||
"pem-rfc7468 0.2.3",
|
"pem-rfc7468",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2014,8 +1989,8 @@ version = "0.7.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447"
|
checksum = "ee3ef9b64d26bad0536099c816c6734379e45bbd5f14798def6809e5cc350447"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"der",
|
||||||
"pem-rfc7468 0.2.3",
|
"pem-rfc7468",
|
||||||
"pkcs1",
|
"pkcs1",
|
||||||
"spki",
|
"spki",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
@@ -2325,16 +2300,6 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "sec1"
|
|
||||||
version = "0.2.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1"
|
|
||||||
dependencies = [
|
|
||||||
"der 0.5.1",
|
|
||||||
"generic-array",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "secrecy"
|
name = "secrecy"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
@@ -2605,7 +2570,7 @@ version = "0.4.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32"
|
checksum = "5c01a0c15da1b0b0e1494112e7af814a678fec9bd157881b49beac661e9b6f32"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der 0.4.5",
|
"der",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2623,21 +2588,6 @@ dependencies = [
|
|||||||
"tokio-uds",
|
"tokio-uds",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ssh-key"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b6387edc9cff6c3c6572fcdcfb632a52b61e09d418a75ffa42fcbb1d6751fa3c"
|
|
||||||
dependencies = [
|
|
||||||
"base64ct",
|
|
||||||
"pem-rfc7468 0.5.1",
|
|
||||||
"rand_core 0.6.3",
|
|
||||||
"sec1",
|
|
||||||
"sha2 0.10.2",
|
|
||||||
"signature",
|
|
||||||
"zeroize",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "static_assertions"
|
name = "static_assertions"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ yubico_manager = "0.9"
|
|||||||
x509 = "0.2"
|
x509 = "0.2"
|
||||||
x509-parser = "0.13"
|
x509-parser = "0.13"
|
||||||
ssh-agent = { version = "0.2.3", features = ["agent"] }
|
ssh-agent = { version = "0.2.3", features = ["agent"] }
|
||||||
ssh-key = "0.4.0"
|
#ssh-key = "0.4.0"
|
||||||
#ctap-hid-fido2 = "2.1.3"
|
#ctap-hid-fido2 = "2.1.3"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use openssl::pkey::PKey;
|
|||||||
use openssl::pkey::Private;
|
use openssl::pkey::Private;
|
||||||
use openssl::rsa::Rsa;
|
use openssl::rsa::Rsa;
|
||||||
use openssl::sign::Signer;
|
use openssl::sign::Signer;
|
||||||
use rust_util::information;
|
use rust_util::{debugging, information};
|
||||||
use ssh_agent::agent::Agent;
|
use ssh_agent::agent::Agent;
|
||||||
use ssh_agent::proto::{from_bytes, RsaPublicKey, to_bytes};
|
use ssh_agent::proto::{from_bytes, RsaPublicKey, to_bytes};
|
||||||
use ssh_agent::proto::message::{self, Message, SignRequest};
|
use ssh_agent::proto::message::{self, Message, SignRequest};
|
||||||
@@ -58,7 +58,7 @@ impl KeyStorage {
|
|||||||
let n = with_sign(rsa.n().to_vec());
|
let n = with_sign(rsa.n().to_vec());
|
||||||
ssh_key.extend_from_slice(&(n.len() as u32).to_be_bytes()[..]);
|
ssh_key.extend_from_slice(&(n.len() as u32).to_be_bytes()[..]);
|
||||||
ssh_key.extend_from_slice(&n);
|
ssh_key.extend_from_slice(&n);
|
||||||
information!("{:?}", ssh_key);
|
debugging!("{:?}", ssh_key);
|
||||||
information!("ssh-rsa {} {}", base64::encode(&ssh_key), ident.comment);
|
information!("ssh-rsa {} {}", base64::encode(&ssh_key), ident.comment);
|
||||||
Self {
|
Self {
|
||||||
identities: RwLock::new(vec![ident])
|
identities: RwLock::new(vec![ident])
|
||||||
|
|||||||
Reference in New Issue
Block a user