Skip to content

Commit

Permalink
fix windows agent key
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Oct 31, 2024
1 parent a600c95 commit 7a60568
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions agent/sftp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func InitializeSFTPConfig(server string, basePath string) *SFTPConfig {
privateKey, pubKey, err := GenerateKeyPair(4096)
if err != nil {
log.Println("Failed to generate SSH key pair.")
log.Println(err)
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions agent/sftp/ssh_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func GenerateKeyPair(bitSize int) (*ssh.Signer, []byte, error) {
return nil, nil, err
}

publicKey, err := generatePublicKey(privateKey)
publicKey, err := generatePublicKey(&privateKey.PublicKey)
if err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -48,7 +48,7 @@ func encodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte {
return privatePEM
}

func generatePublicKey(privatekey *rsa.PrivateKey) ([]byte, error) {
func generatePublicKey(privatekey *rsa.PublicKey) ([]byte, error) {
publicRsaKey, err := ssh.NewPublicKey(privatekey)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7a60568

Please sign in to comment.