Skip to content

Update AddHostKey to avoid always appending #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 23, 2019
Merged

Conversation

belak
Copy link
Collaborator

@belak belak commented Oct 16, 2019

As it mentions in the comment, this is based on the code from x/crypto/ssh and is done to optimize dynamically loading keys at runtime (to avoid keeping old keys around). I've been experimenting and I would have just done it with the config callback, but it seems like there's not a great way to do this (since we auto-generate a key if there are none, and always add the HostSigners to the server config).

The config at runtime has a number of race conditions still present (they mostly happen if you set an option at runtime directly) but the one for AddHostKey should be fixed.

@belak belak requested a review from progrium October 16, 2019 17:13
@belak
Copy link
Collaborator Author

belak commented Oct 16, 2019

There seems to be a test that's hanging only in CI... so I'll have to look into that.

@belak
Copy link
Collaborator Author

belak commented Oct 16, 2019

Ok, I rewrote TestSignals - I couldn't get t.Fatal to work from inside a goroutine, so I passed errors out.

@belak belak merged commit 59d6e45 into master Oct 23, 2019
@belak belak deleted the optimize-add-host-key branch October 23, 2019 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant