message: Add test cases showing secret key parsing failure with CRLF
diff: @@ -519,11 +519,10 @@ AAAEADBJvjZT8X6JRJI8xVq/1aU8nMVgOtVnmdwqWwrSlXG3sKLqeplhpW+uObz5dvMgjz
  -----END OPENSSH PRIVATE KEY-----";
  pub(crate) const TEST_SSH_ED25519_PK: &str = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHsKLqeplhpW+uObz5dvMgjz1OxfM/XXUB+VHtZ6isGN alice@rust";
  - #[test]
  - fn secret_key_encoding() {
  - let buf = BufReader::new(TEST_SK.as_bytes());
  + fn valid_secret_key_encoding(keydata: &str, num_keys: usize) {
  + let buf = BufReader::new(keydata.as_bytes());
  let keys = Identity::from_buffer(buf).unwrap();
  - assert_eq!(keys.len(), 1);
  + assert_eq!(keys.len(), num_keys);
  let key = match keys[0].key() {
  IdentityKey::Unencrypted(key) => key,
  _ => panic!("key should be unencrypted"),
  @@ -531,6 +530,53 @@ AAAEADBJvjZT8X6JRJI8xVq/1aU8nMVgOtVnmdwqWwrSlXG3sKLqeplhpW+uObz5dvMgjz
  assert_eq!(key.to_string().expose_secret(), TEST_SK);
  }
  + #[test]
  + fn secret_key_encoding() {
  + valid_secret_key_encoding(TEST_SK, 1);
  + }
  +
  + #[test]
  + fn secret_key_lf() {
  + valid_secret_key_encoding(&format!("{}\n", TEST_SK), 1);
  + }
  +
  + #[test]
  + fn two_secret_keys_lf() {
  + valid_secret_key_encoding(&format!("{}\n{}", TEST_SK, TEST_SK), 2);
  + }
  +
  + #[test]
  + fn secret_key_with_comment_lf() {
  + valid_secret_key_encoding(&format!("# Foo bar baz\n{}", TEST_SK), 1);
  + valid_secret_key_encoding(&format!("{}\n# Foo bar baz", TEST_SK), 1);
  + }
  +
  + #[test]
  + fn secret_key_with_empty_line_lf() {
  + valid_secret_key_encoding(&format!("\n\n{}", TEST_SK), 1);
  + }
  +
  + #[test]
  + fn secret_key_crlf() {
  + valid_secret_key_encoding(&format!("{}\r\n", TEST_SK), 1);
  + }
  +
  + #[test]
  + fn two_secret_keys_crlf() {
  + valid_secret_key_encoding(&format!("{}\r\n{}", TEST_SK, TEST_SK), 2);
  + }
  +
  + #[test]
  + fn secret_key_with_comment_crlf() {
  + valid_secret_key_encoding(&format!("# Foo bar baz\r\n{}", TEST_SK), 1);
  + valid_secret_key_encoding(&format!("{}\r\n# Foo bar baz", TEST_SK), 1);
  + }
  +
  + #[test]
  + fn secret_key_with_empty_line_crlf() {
  + valid_secret_key_encoding(&format!("\r\n\r\n{}", TEST_SK), 1);
  + }
  +
  #[test]
  fn incomplete_secret_key_encoding() {
  let buf = BufReader::new(&TEST_SK.as_bytes()[..4]);
  