dnaeon / rust-sshkeys

Rust library for reading OpenSSH public keys and certificates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compilation error

vincentserpoul opened this issue · comments

actually, before fixing #1, It doesn't compile with rust 1.43.1

use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
error: trait objects without an explicit `dyn` are deprecated

I'll check it out, thanks. It's been a while since I haven't touched that code and Rust changed as well :)

no worries! I think a common way of handling error these days is to use anyhow or thiserror libs from dtolnay. I can start with this PR maybe? or should I just let you look into it out first?

Just pushed a fix for it.

Here's the result of cargo test.

   Compiling sshkeys v0.2.0 (/Users/mnikolov/Projects/rust/sshkeys)
    Finished test [unoptimized + debuginfo] target(s) in 2.44s
     Running target/debug/deps/sshkeys-e9deb9b392c4eb29

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/keys-f3733c5aa9c149ce

running 15 tests
test test_ed25519_pubkey ... ok
test test_ecdsa_nistp256_pubkey ... ok
test test_ecdsa_nistp521_pubkey ... ok
test test_ecdsa_nistp384_pubkey ... ok
test test_ed25519_host_cert ... ok
test test_dsa_pubkey_1024 ... ok
test test_rsa_not_cert ... ok
test test_rsa_pubkey_2048_invalid_format ... ok
test test_rsa_pubkey_2048_unknown_keytype ... ok
test test_rsa_pubkey_1024 ... ok
test test_rsa_pubkey_2048 ... ok
test test_ecdsa_user_cert ... ok
test test_dsa_user_cert ... ok
test test_ed25519_user_cert ... ok
test test_rsa_user_cert ... ok

test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests sshkeys

running 25 tests
test src/pubkey.rs - pubkey::PublicKey::fingerprint (line 449) ... ok
test src/cert.rs - cert::Certificate::from_path (line 91) ... ok
test src/cert.rs - cert::Certificate::from_string (line 109) ... ok
test src/pubkey.rs - pubkey::PublicKey::bits (line 386) ... ok
test src/pubkey.rs - pubkey::Fingerprint::compute (line 210) ... ok
test src/pubkey.rs - pubkey::Curve::from_identifier (line 86) ... ok
test src/keytype.rs - keytype::KeyType::from_name (line 54) ... ok
test src/pubkey.rs - pubkey::PublicKey::encode (line 412) ... ok
test src/pubkey.rs - pubkey::PublicKey::fingerprint_with (line 467) ... ok
test src/pubkey.rs - pubkey::PublicKey::from_bytes (line 307) ... ok
test src/pubkey.rs - pubkey::PublicKey::from_path (line 245) ... ok
test src/pubkey.rs - pubkey::PublicKey::from_string (line 262) ... ok
test src/pubkey.rs - pubkey::PublicKey::write (line 483) ... ok
test src/reader.rs - reader::Reader::new (line 17) ... ok
test src/reader.rs - reader::Reader::read_bytes (line 56) ... ok
test src/reader.rs - reader::Reader::read_mpint (line 91) ... ok
test src/reader.rs - reader::Reader::read_string (line 112) ... ok
test src/reader.rs - reader::Reader::read_u32 (line 129) ... ok
test src/reader.rs - reader::Reader::read_u64 (line 155) ... ok
test src/reader.rs - reader::Reader::set_offset (line 34) ... ok
test src/writer.rs - writer::Writer::into_bytes (line 83) ... ok
test src/writer.rs - writer::Writer::new (line 13) ... ok
test src/writer.rs - writer::Writer::write_bytes (line 25) ... ok
test src/writer.rs - writer::Writer::write_mpint (line 60) ... ok
test src/writer.rs - writer::Writer::write_string (line 43) ... ok

test result: ok. 25 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Should be ok now.

Published new version on crates.io as well.

https://crates.io/crates/sshkeys