Skip to content

Commit

Permalink
no_std fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Dec 29, 2024
1 parent 64d5dd4 commit 0f46ee4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ssh-key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- uses: RustCrypto/actions/cargo-hack-install@master
- run: cargo hack build --target ${{ matrix.target }} --feature-powerset --exclude-features default,dsa,ed25519,getrandom,p256,p384,p521,rsa,tdes,std --release
- run: cargo hack build --target ${{ matrix.target }} --feature-powerset --exclude-features default,dsa,ed25519,getrandom,p256,p384,p521,rsa,tdes,std,ppk --release
- run: cargo build --target ${{ matrix.target }} --no-default-features --features alloc,crypto,dsa,encryption,tdes --release

test:
Expand All @@ -88,7 +88,7 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
- uses: RustCrypto/actions/cargo-hack-install@master
- run: cargo hack test --feature-powerset --exclude-features default,dsa,ed25519,getrandom,p256,p384,p521,rsa,tdes,std --release
- run: cargo hack test --feature-powerset --exclude-features default,dsa,ed25519,getrandom,p256,p384,p521,rsa,tdes,std,ppk --release
- run: cargo test --release
- run: cargo test --release --features getrandom
- run: cargo test --release --features std
Expand Down
2 changes: 1 addition & 1 deletion ssh-key/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bcrypt-pbkdf = { version = "=0.11.0-pre.1", optional = true, default-features =
bigint = { package = "num-bigint-dig", version = "0.8", optional = true, default-features = false }
dsa = { version = "=0.7.0-pre.1", optional = true, default-features = false }
ed25519-dalek = { version = "=2.2.0-pre", optional = true, default-features = false }
hex = { version = "0.4", optional = true }
hex = { version = "0.4", optional = true, default-features = false, features = ["alloc"] }
hmac = { version = "=0.13.0-pre.4", optional = true }
home = { version = "0.5", optional = true }
p256 = { version = "=0.14.0-pre.1", optional = true, default-features = false, features = ["ecdsa"] }
Expand Down
1 change: 1 addition & 0 deletions ssh-key/src/ppk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ fn decode_private_key_as(
)?))
}

#[cfg(feature = "rsa")]
(Algorithm::Rsa { .. }, KeyData::Rsa(pk)) => {
use crate::private::{RsaKeypair, RsaPrivateKey};

Expand Down
2 changes: 2 additions & 0 deletions ssh-key/tests/private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ fn decode_ecdsa_p256_ppk_encrypted() {
);
}

#[cfg(feature = "p256")]
fn validate_ecdsa_p256(key: PrivateKey) {
assert_eq!(
Algorithm::Ecdsa {
Expand Down Expand Up @@ -360,6 +361,7 @@ fn decode_rsa_3072_ppk_encrypted() {
);
}

#[cfg(feature = "rsa")]
fn validate_rsa_3072(key: PrivateKey) {
assert_eq!(Algorithm::Rsa { hash: None }, key.algorithm());
assert_eq!(Cipher::None, key.cipher());
Expand Down

0 comments on commit 0f46ee4

Please sign in to comment.