kmiya-culti / RLogin

RLoginは、Windows上で動作するターミナルソフトです
http://nanno.bf1.jp/softlib/man/rlogin/
MIT License
478 stars 17 forks source link

Rlogin-generated ed25519 key not readable by other software #26

Closed jchevali closed 6 years ago

jchevali commented 6 years ago

If I generate a ed25519 key within Rlogin and I export the private key, it is not readable by other software, e.g., PuTTYgen, or ssh-keygen. This problem only affects this type of keys; it does not affect other types of keys.

kmiya-culti commented 6 years ago

行末コードがCR+LFになっていました。opensshでは、LFのみでないと認識されないようでした。 ご報告有り難うございました。

==== Automatic translation ==== Line end code was CR + LF. It seems that openssh does not recognize that it is not only LF. Thank you for your report.

jchevali commented 6 years ago

I changed the line endings to LF and that fixes it for ssh-keygen, but it does not fix it for PuTTYgen.

Steps to reproduce:

  1. Create a ed25519 key using Rlogin with comment 'foobar' and password 'oldpassword'
  2. Using Rlogin, export the key to a file called 'oldfile'
  3. In the file system, change line ending of oldfile by means of command 'dos2unix oldfile'
  4. In the file system, make a copy of oldfile, call it 'newfile'

At this point, both files are identical and are supposed to have the proper line ending.

  1. Using ssh-keygen, change the passphrase of newfile to 'newpassword' (ssh-keygen -p -f newfile)

At this point, we can test that ssh-keygen can read both files.

  1. Issue 'ssh-keygen -e -f oldfile' and 'ssh-keygen -e -f newfile' and check the contents are displayed ok

Now we will test whether PuTTYgen can read both files. It will not.

  1. Try and open oldfile with PuTTYgen (menu Conversions->Import key). It will fail.
  2. Try and open newfile with PuTTYgen (menu Conversions->Import key). It will succeed.

This proves that PuTTYgen can read a file that was post-processed by ssh-keygen, but it cannot process the original file exported from Rlogin, even after a line endings conversion.

kmiya-culti commented 6 years ago

openssh-7.6から暗号形式が"aes256-cbc"から"aes256-ctr"に変更されました。 PuTTYgenが"aes256-ctr"で暗号化されたファイルを読めないようです。

==== Automatic translation ==== From openssh - 7.6, the encryption format changed from "aes256-cbc" to "aes256-ctr". It seems that PuTTYgen can not read the file encrypted with "aes256-ctr".

jchevali commented 6 years ago

Thanks. I've reported this to the makers of PuTTYgen.

jchevali commented 6 years ago

This feature is now in PuTTY(gen). The current development snapshot passes the test. There will be a new stable release noon.