-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from HsuJv/ver0_4_0
Release v0.4
- Loading branch information
Showing
77 changed files
with
1,486 additions
and
992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.idea | ||
target | ||
.gitignore | ||
.vscode | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "ssh-rs" | ||
version = "0.3.3" | ||
version = "0.4.0" | ||
edition = "2021" | ||
authors = [ | ||
"Gao Xiang Kang <[email protected]>", | ||
|
@@ -14,42 +14,58 @@ repository = "https://github.com/1148118271/ssh-rs" | |
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[features] | ||
dangerous-algorithms = ["dangerous-rsa-sha1", "dangerous-dh-group1-sha1"] | ||
dangerous-rsa-sha1 = ["sha1"] | ||
dangerous-dh-group1-sha1 = [] | ||
deprecated-algorithms = [ | ||
"deprecated-rsa-sha1", | ||
"deprecated-dh-group1-sha1", | ||
"deprecated-aes-cbc", | ||
"deprecated-des-cbc", | ||
] | ||
deprecated-rsa-sha1 = ["dep:sha1"] | ||
deprecated-dh-group1-sha1 = ["dep:sha1"] | ||
deprecated-aes-cbc = ["dep:cbc", "dep:cipher"] | ||
deprecated-des-cbc = ["dep:cbc", "dep:cipher", "dep:des"] | ||
scp = ["dep:filetime"] | ||
|
||
[lib] | ||
name = "ssh" | ||
path = "src/lib.rs" | ||
|
||
[dependencies] | ||
log = "0.4" | ||
rand = "0.8" | ||
num-bigint = { version = "0.4", features = ["rand"] } | ||
## error | ||
thiserror = "^1.0" | ||
|
||
## log | ||
tracing = { version = "^0.1", features = ["log"] } | ||
|
||
## string enum | ||
strum = "0.25" | ||
strum_macros = "0.25" | ||
|
||
## algorithm | ||
rand = "0.8" | ||
num-bigint = { version = "0.4", features = ["rand"] } | ||
# the crate rsa has removed the internal hash implement from 0.7.0 | ||
sha1 = { version = "0.10.5", default-features = false, features = ["oid"], optional = true } | ||
sha2 = { version = "0.10.6", default-features = false, features = ["oid"]} | ||
rsa = "0.9" | ||
aes = "0.8" | ||
ctr = "0.9" | ||
des = { version = "0.8", optional = true } | ||
cbc = { version = "0.1", optional = true } | ||
cipher = { version = "0.4", optional = true } | ||
ssh-key = { version = "0.6", features = ["rsa", "ed25519", "alloc"]} | ||
signature = "2.1" | ||
ring = "0.16" | ||
filetime = "0.2" | ||
|
||
# async | ||
# [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
# tokio = { version = "^1", features = ["full"] } | ||
## utils | ||
filetime = { version = "0.2", optional = true } | ||
|
||
[target.'cfg(target_arch = "wasm32")'.dependencies] | ||
getrandom = { version = "0.2", features = ["js"] } | ||
# tokio = { version = "^1", features = [ | ||
# "sync", | ||
# "macros", | ||
# "io-util", | ||
# "rt", | ||
# "time" | ||
# ]} | ||
|
||
|
||
[dev-dependencies] | ||
tracing-subscriber = { version = "^0.3" } | ||
paste = "1" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,19 @@ fn main() { | |
### 启用全局日志: | ||
|
||
```rust | ||
ssh::debug(); | ||
use ssh; | ||
use tracing::Level; | ||
use tracing_subscriber::FmtSubscriber; | ||
// this will generate some basic event logs | ||
// a builder for `FmtSubscriber`. | ||
let subscriber = FmtSubscriber::builder() | ||
// all spans/events with a level higher than INFO (e.g, info, warn, etc.) | ||
// will be written to stdout. | ||
.with_max_level(Level::INFO) | ||
// completes the builder. | ||
.finish(); | ||
|
||
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed"); | ||
``` | ||
|
||
### 设置超时时间: | ||
|
@@ -82,14 +94,19 @@ ssh::create_session().timeout(Some(std::time::Duration::from_secs(5))); | |
* `ssh-ed25519` | ||
* `rsa-sha2-512` | ||
* `rsa-sha2-256` | ||
* `rsa-sha` (features = ["dangerous-rsa-sha1"]) | ||
* `rsa-sha` (features = ["deprecated-rsa-sha1"]) | ||
|
||
#### 3. 加密算法(客户端到服务端) | ||
|
||
* `[email protected]` | ||
* `aes128-ctr` | ||
* `aes192-ctr` | ||
* `aes256-ctr` | ||
* `aes128-cbc` (features = ["deprecated-aes-cbc"]) | ||
* `aes192-cbc` (features = ["deprecated-aes-cbc"]) | ||
* `aes256-cbc` (features = ["deprecated-aes-cbc"]) | ||
* `3des-cbc` (features = ["deprecated-des-cbc"]) | ||
|
||
|
||
#### 4. 加密算法(服务端到客户端) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.