mirror of
				https://github.com/appleboy/drone-ssh.git
				synced 2025-10-29 00:51:15 +08:00 
			
		
		
		
	[easyssh] logs errors when parsing public keys (appleboy/easyssh-proxy#33)
* logs errors when parsing public keys * adds missing newline https://github.com/appleboy/drone-ssh/commit/b777a323265
This commit is contained in:
		
							parent
							
								
									6e20c74ff3
								
							
						
					
					
						commit
						71cbc0efd3
					
				
							
								
								
									
										9
									
								
								vendor/github.com/appleboy/easyssh-proxy/easyssh.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/appleboy/easyssh-proxy/easyssh.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -9,6 +9,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io" | 	"io" | ||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
|  | 	"log" | ||||||
| 	"net" | 	"net" | ||||||
| 	"os" | 	"os" | ||||||
| 	"path/filepath" | 	"path/filepath" | ||||||
| @ -80,13 +81,17 @@ func getSSHConfig(config DefaultConfig) *ssh.ClientConfig { | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if config.KeyPath != "" { | 	if config.KeyPath != "" { | ||||||
| 		if pubkey, err := getKeyFile(config.KeyPath); err == nil { | 		if pubkey, err := getKeyFile(config.KeyPath); err != nil { | ||||||
|  | 			log.Printf("getKeyFile: %v\n", err) | ||||||
|  | 		} else { | ||||||
| 			auths = append(auths, ssh.PublicKeys(pubkey)) | 			auths = append(auths, ssh.PublicKeys(pubkey)) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if config.Key != "" { | 	if config.Key != "" { | ||||||
| 		if signer, err := ssh.ParsePrivateKey([]byte(config.Key)); err == nil { | 		if signer, err := ssh.ParsePrivateKey([]byte(config.Key)); err != nil { | ||||||
|  | 			log.Printf("ssh.ParsePrivateKey: %v\n", err) | ||||||
|  | 		} else { | ||||||
| 			auths = append(auths, ssh.PublicKeys(signer)) | 			auths = append(auths, ssh.PublicKeys(signer)) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Diep Pham
						Diep Pham