Make Encryption Algorithm's ssh2_id Property Accessible in .NET Assembly

Advertisement

TheCliGuy
Joined:
Posts:
5

Make Encryption Algorithm's ssh2_id Property Accessible in .NET Assembly

When a session is opened to an SSH/SFTP server, the WinSCP log includes details of the encryption algorithm that's used.

The PuTTY code responsible for recording the encryption algorithm uses a human readable description. This description has no significance outside of PuTTY, consequently this makes it impossible to cross-reference it against the IANA's Secure Shell Encryption Algorithm Name registry (https://www.iana.org/assignments/ssh-parameters/ssh-parameters.xhtml#ssh-parameters-17).

Here's the code that's responsible for writing to the log:

https://git.tartarus.org/?p=simon/putty.git;a=blob;f=ssh2bpp.c;hb=2762a2025f094bf8ccb75c0bdd7c655bc953f2f1#l132

 132         bpp_logevent("Initialised %s outbound encryption",
 133                      ssh_cipher_alg(s->out.cipher)->text_name);
 134     } else {

 190         bpp_logevent("Initialised %s inbound encryption",
 191                      ssh_cipher_alg(s->in.cipher)->text_name);
 192     } else {

The description is held in the text_name property of an initialised ssh_cipheralg struct. The initialised ssh_cipheralg also contains the encryption algorithm's official IANA name
in the ssh2_id property.
* ssh_cipheralg definition: https://git.tartarus.org/?p=simon/putty.git;a=blob;f=ssh.h;hb=2762a2025f094bf8ccb75c0bdd7c655bc953f2f1#l627
* ssh_cipheralg initialisation: https://git.tartarus.org/?p=simon/putty.git;a=blob;f=sshaes.c;hb=2762a2025f094bf8ccb75c0bdd7c655bc953f2f1#l108

Would it be possible to expose the ssh2_id so it's accessible in the WinSCP .Net assembly (WinSCPnet.dll)?

ssh_aes256_sdctr_hw.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
33,846
Location:
Prague, Czechia

Re: Make Encryption Algorithm's ssh2_id Property Accessible in .NET Assembly

Thanks for your suggestion.

This request has been added to the tracker:
https://winscp.net/tracker/1886

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.

Reply with quote

TheCliGuy
Joined:
Posts:
5

Re: Make Encryption Algorithm's ssh2_id Property Accessible in .NET Assembly

Hello Martin,

Thank you for providing the development version with my suggestion implemented and for doing it so quickly.

I did reply to your email to let you know that I had tested it and it worked perfectly - but I'm not sure if you saw this.

I made one more suggestion which was to also make the ssh2_id value visible from the UI under 'Session' > 'Server/Protocol Information'.

Reply with quote

martin
Site Admin
martin avatar

Re: Make Encryption Algorithm's ssh2_id Property Accessible in .NET Assembly

Thanks for your feedback.

I'll make the GUI change, if more people ask for this. Thanks for your understanding.

Reply with quote

Advertisement

You can post new topics in this forum