This commit is contained in:
ginuerzh 2020-05-23 21:26:33 +08:00
parent d11f824858
commit 2707a8f0a9
3 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,7 @@ import (
) )
// Version is the gost version. // Version is the gost version.
const Version = "2.11.0" const Version = "2.11.1"
// Debug is a flag that enables the debug log. // Debug is a flag that enables the debug log.
var Debug bool var Debug bool

View File

@ -1,6 +1,6 @@
name: gost name: gost
type: app type: app
version: '2.11.0' version: '2.11.1'
title: GO Simple Tunnel title: GO Simple Tunnel
summary: A simple security tunnel written in golang summary: A simple security tunnel written in golang
description: | description: |

2
ssh.go
View File

@ -31,6 +31,7 @@ var (
errSessionDead = errors.New("session is dead") errSessionDead = errors.New("session is dead")
) )
// ParseSSHKeyFile parses ssh key file.
func ParseSSHKeyFile(fp string) (ssh.Signer, error) { func ParseSSHKeyFile(fp string) (ssh.Signer, error) {
key, err := ioutil.ReadFile(fp) key, err := ioutil.ReadFile(fp)
if err != nil { if err != nil {
@ -39,6 +40,7 @@ func ParseSSHKeyFile(fp string) (ssh.Signer, error) {
return ssh.ParsePrivateKey(key) return ssh.ParsePrivateKey(key)
} }
// ParseSSHAuthorizedKeysFile parses ssh Authorized Keys file.
func ParseSSHAuthorizedKeysFile(fp string) (map[string]bool, error) { func ParseSSHAuthorizedKeysFile(fp string) (map[string]bool, error) {
authorizedKeysBytes, err := ioutil.ReadFile(fp) authorizedKeysBytes, err := ioutil.ReadFile(fp)
if err != nil { if err != nil {