MCPcopy Index your code
hub / github.com/coder/coder / UpdateHostSigner

Method UpdateHostSigner

agent/agentssh/agentssh.go:1370–1382  ·  view source on GitHub ↗

UpdateHostSigner updates the host signer with a new key generated from the provided seed. If an existing host key exists with the same algorithm, it is overwritten

(seed int64)

Source from the content-addressed store, hash-verified

1368// UpdateHostSigner updates the host signer with a new key generated from the provided seed.
1369// If an existing host key exists with the same algorithm, it is overwritten
1370func (s *Server) UpdateHostSigner(seed int64) error {
1371 key, err := CoderSigner(seed)
1372 if err != nil {
1373 return err
1374 }
1375
1376 s.mu.Lock()
1377 defer s.mu.Unlock()
1378
1379 s.srv.AddHostKey(key)
1380
1381 return nil
1382}
1383
1384// CoderSigner generates a deterministic SSH signer based on the provided seed.
1385// It uses RSA with a key size of 2048 bits.

Callers 8

TestServer_X11Function · 0.95
TestNewServer_SignalFunction · 0.95
createTailnetMethod · 0.80
Test_sessionStart_orphanFunction · 0.80

Calls 3

CoderSignerFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 7

TestServer_X11Function · 0.76
TestNewServer_SignalFunction · 0.76
Test_sessionStart_orphanFunction · 0.64