mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-10-31 08:11:32 +01:00 
			
		
		
		
	The upstream crypto package now supports sending banners at any time during authentication, so the Tailscale fork of crypto/ssh is no longer necessary. github.com/tailscale/golang-x-crypto is still needed for some custom ACME autocert functionality. tempfork/gliderlabs is still necessary because of a few other customizations, mostly related to TTY handling. Originally implemented in 46fd4e58a27495263336b86ee961ee28d8c332b7, which was reverted in b60f6b849af1fae1cf343be98f7fb1714c9ea165 to keep the change out of v1.80. Updates #8593 Signed-off-by: Percy Wegmann <percy@tailscale.com>
		
			
				
	
	
		
			34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package ssh
 | |
| 
 | |
| import gossh "golang.org/x/crypto/ssh"
 | |
| 
 | |
| // PublicKey is an abstraction of different types of public keys.
 | |
| type PublicKey interface {
 | |
| 	gossh.PublicKey
 | |
| }
 | |
| 
 | |
| // The Permissions type holds fine-grained permissions that are specific to a
 | |
| // user or a specific authentication method for a user. Permissions, except for
 | |
| // "source-address", must be enforced in the server application layer, after
 | |
| // successful authentication.
 | |
| type Permissions struct {
 | |
| 	*gossh.Permissions
 | |
| }
 | |
| 
 | |
| // A Signer can create signatures that verify against a public key.
 | |
| type Signer interface {
 | |
| 	gossh.Signer
 | |
| }
 | |
| 
 | |
| // ParseAuthorizedKey parses a public key from an authorized_keys file used in
 | |
| // OpenSSH according to the sshd(8) manual page.
 | |
| func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) {
 | |
| 	return gossh.ParseAuthorizedKey(in)
 | |
| }
 | |
| 
 | |
| // ParsePublicKey parses an SSH public key formatted for use in
 | |
| // the SSH wire protocol according to RFC 4253, section 6.6.
 | |
| func ParsePublicKey(in []byte) (out PublicKey, err error) {
 | |
| 	return gossh.ParsePublicKey(in)
 | |
| }
 |