Skip to content

Commit 1fc3584

Browse files
committed
ssh-key: skip DSA encoding integration test
Doesn't check if the `ssh-keygen` CLI utility can parse our DSA keys, since newer versions have dropped DSA support Closes #424
1 parent 90671b6 commit 1fc3584

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

ssh-key/tests/private_key.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ fn round_trip_non_utf8_comment_openssh() {
615615
#[cfg(feature = "alloc")]
616616
#[test]
617617
fn encode_dsa_openssh() {
618-
encoding_test(OPENSSH_DSA_EXAMPLE)
618+
round_trip_test(OPENSSH_DSA_EXAMPLE);
619619
}
620620

621621
#[cfg(all(feature = "alloc", feature = "p256"))]
@@ -663,17 +663,23 @@ fn encode_custom_algorithm_openssh() {
663663
/// Common behavior of all encoding tests
664664
#[cfg(feature = "alloc")]
665665
fn encoding_test(private_key: &str) {
666+
let key = round_trip_test(private_key);
667+
668+
#[cfg(feature = "std")]
669+
if !matches!(key.algorithm(), Algorithm::Other(_)) {
670+
encoding_integration_test(key)
671+
}
672+
}
673+
674+
fn round_trip_test(private_key: &str) -> PrivateKey {
666675
let key = PrivateKey::from_openssh(private_key).unwrap();
667676

668677
// Ensure key round-trips
669678
let pem = key.to_openssh(LineEnding::LF).unwrap();
670679
let key2 = PrivateKey::from_openssh(&*pem).unwrap();
671680
assert_eq!(key, key2);
672681

673-
#[cfg(feature = "std")]
674-
if !matches!(key.algorithm(), Algorithm::Other(_)) {
675-
encoding_integration_test(key)
676-
}
682+
key
677683
}
678684

679685
/// Parse PEM encoded using `PrivateKey::to_openssh` using the `ssh-keygen` utility.

0 commit comments

Comments
 (0)