dswisher / swish-sftp

Tinkering with SFTP protocol in C#
MIT License
3 stars 0 forks source link

Properly import host keys #1

Open dswisher opened 4 years ago

dswisher commented 4 years ago

The test script currently sets the known hosts file to /dev/null, as the server is generating a new host key each time.

Pull host key from config, and import it into the host key algorithm.

dswisher commented 4 years ago

The code is now reading the config for algorithm-specific host key file and importing it. The code needs to be cleaned up, with better error handling and whatnot.

The "parser" used to read the host key file is overly simplistic. See RFC 4716 for things like Comments that would break the existing implementation. See this blog post for a very helpful overview.

Also note that in C# 5.0, it looks like there will be a parser for these files. See One-shot PEM reader.

hugufc commented 3 years ago

Maybe this and this could help too.