Skip to content

Commit

Permalink
main: fix pubkey authentication support
Browse files Browse the repository at this point in the history
Closes: #1 [via git-merge-pr]
  • Loading branch information
classabbyamp authored and the-maldridge committed Oct 1, 2022
1 parent 098a428 commit 9d8a9af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/hashicorp/go-hclog v1.1.0
github.com/netauth/netauth v0.6.0
github.com/netauth/netauth v0.6.2-0.20221001032653-5eb74f06755e
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.1
google.golang.org/grpc v1.43.0
Expand All @@ -25,6 +25,7 @@ require (
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/text v0.3.7 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGg
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/netauth/netauth v0.6.0 h1:1+IVOANpIfQoD680+WF1mIRMtgwtfUFNvrrf49xQKdk=
github.com/netauth/netauth v0.6.0/go.mod h1:4PEbISVqRCQaXaDAt289w3nK9UhoF8/ZOLy31Hbv7ds=
github.com/netauth/netauth v0.6.2-0.20221001032653-5eb74f06755e h1:4jzHpfk2I4s59jKujFS9vxDhMWGK2VjpyHq48D1QR0c=
github.com/netauth/netauth v0.6.2-0.20221001032653-5eb74f06755e/go.mod h1:4PEbISVqRCQaXaDAt289w3nK9UhoF8/ZOLy31Hbv7ds=
github.com/netauth/protocol v0.0.0-20210918062754-7fee492ffcbd h1:4yVpQ/+li28lQ/daYCWeDB08obRmjaoAw2qfFFaCQ40=
github.com/netauth/protocol v0.0.0-20210918062754-7fee492ffcbd/go.mod h1:wpK5wqysOJU1w2OxgG65du8M7UqBkxzsNaJdjwiRqAs=
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
Expand Down Expand Up @@ -110,6 +112,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
Expand Down
11 changes: 3 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"google.golang.org/grpc/status"

"github.com/netauth/netauth/pkg/netauth"
"github.com/netauth/netauth/pkg/netauth/subtle"
)

var (
Expand Down Expand Up @@ -86,14 +87,8 @@ func doAuth(c *netauth.Client) {
dumpUser(minimalSFTPGoUser{})
return
}
found := false
for _, k := range keys["SSH"] {
if k == publickey {
found = true
break
}
}
if !found {
err = subtle.CompareSSHKeys(keys["SSH"], publickey)
if err != nil {
dumpUser(minimalSFTPGoUser{})
return
}
Expand Down

0 comments on commit 9d8a9af

Please sign in to comment.