Maybe of info (general tip, maybe unrelated): https://www.greenend.org.uk/rjk/sftp/sftpversions.html https://www.greenend.org.uk/rjk/sftp/sftpimpls.html
Hope this is useful when writing sftp software. I do, using my own ssh and sftp implementations, supporting versions 3 - 6. See: https://github.com/stefbon/fs-workspace/tree/master/sftp I'm now rewriting lot's of code, making the sftp code more standalone than it's now. Stef Bon