Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Generate code - SSH passphrase saved under wrong sessionoption

This bug has been added to the tracker:
https://winscp.net/tracker/1687
Michael M

Generate code - SSH passphrase saved under wrong sessionoption

Version 5.13.4 (Build 8731)

For an SFTP upload, the "Generate Code.." function incorrectly stores the SSH private key encryption passphrase in the SessionOption property 'Password', rather than in the correct property 'PrivateKeyPassphrase'. This causes the script to fail authentication when it tries to open the session.


Steps that produced this bug for me:

1) Opened an SFTP connection to the IP address of an SFTP server on a non-standard port using no password and a passphrase-protected 4096-bit RSA PuTTYgen ppk private key file.

2) Right-clicked a file > "Upload (F5)" > "Upload..."

3) In the dialog box, clicked the arrow next to "Transfer settings..." and chose "Generate code..."

4) Noted that in every script or .NET assembly code option, the SSH key passphrase is treated like an SSH password and not an SSH private key passphrase.

For example, in .NET code, it is stored under the SessionOption property 'Password' instead of 'PrivateKeyPassphrase'. And in script code it uses the format <username>:<sshkeypassphrase>@<server>:<port> as though the passphrase was a password.