This will allow SSHServer to have a stable private key without using
--unsafe-stub-private-key. We already had support for reading public
keys and this commit adds support for openssh's proprietary private key
file format. It is unfortunately not standardized, and while I
considered using a custom file format I think that being compatible with
`ssh-keygen` is better for the moment.
As I failed to write a VERIFY that would hit this case, when the shared
secret started with two null bytes, we were silently creating an invalid
mpint which would make the ssh client abort the connection with this
message:
ssh_dispatch_run_fatal: Connection to [Server IP]: incorrect signature
AFAICT, this patch makes the error go away.
This means that we can now decrypt the SERVICE_REQUEST message, and we
log:
Client protocol string: SSH-2.0-OpenSSH_10.0p2 Ubuntu-5ubuntu5.1
KEXINIT message sent
KEX_ECDH_REPLY message sent
NEWKEYS message received, we should use encryption from now on
Service 'ssh-userauth' requested
error: Draw the rest of the owl
This is once again very limited. We only support one `curve25519-sha256`
for the key exchange and `ssh-ed25519` as the host key.
With the SSH_DEBUG macro set and connecting from my host, it now prints:
```
Client protocol string: SSH-2.0-OpenSSH_10.0p2 Ubuntu-5ubuntu5
KEXINIT message sent
KEX_ECDH_REPLY message sent
error: Draw the rest of the owl
```
The client seems happy with the key exchange, and the following message
is encrypted!