mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-27 17:06:27 +02:00
adapt to single-return util.CryptoRandomString
This commit is contained in:
parent
6d34f8b279
commit
2911b6e0a2
@ -166,11 +166,7 @@ func CreateTemporaryAgent(privateKey ed25519.PrivateKey) (string, func(), error)
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
agentID, err := util.CryptoRandomString(16)
|
||||
if err != nil {
|
||||
agent.Close()
|
||||
return "", nil, fmt.Errorf("failed to generate agent ID: %w", err)
|
||||
}
|
||||
agentID := util.CryptoRandomString(16)
|
||||
|
||||
globalAgentManager.mu.Lock()
|
||||
globalAgentManager.agents[agentID] = agent
|
||||
|
||||
@ -17,10 +17,7 @@ import (
|
||||
// createAgentListener creates a Windows named pipe listener for the SSH agent.
|
||||
// Returns the listener, pipe path, and a cleanup function for early-return error paths.
|
||||
func createAgentListener() (net.Listener, string, func(), error) {
|
||||
agentID, err := util.CryptoRandomString(16)
|
||||
if err != nil {
|
||||
return nil, "", nil, fmt.Errorf("failed to generate agent ID: %w", err)
|
||||
}
|
||||
agentID := util.CryptoRandomString(16)
|
||||
pipePath := `\\.\pipe\gitea-ssh-agent-` + agentID
|
||||
|
||||
listener, err := winio.ListenPipe(pipePath, nil)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user