Skip to content

Commit

Permalink
Try out a radius fix (#3461)
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai authored Oct 16, 2017
1 parent 487deba commit 86f967b
Show file tree
Hide file tree
Showing 3 changed files with 3,433 additions and 10 deletions.
13 changes: 3 additions & 10 deletions builtin/credential/radius/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"layeh.com/radius"
. "layeh.com/radius/rfc2865"

"github.com/hashicorp/vault/helper/policyutil"
"github.com/hashicorp/vault/logical"
Expand Down Expand Up @@ -127,16 +128,8 @@ func (b *backend) RadiusLogin(req *logical.Request, username string, password st
hostport := net.JoinHostPort(cfg.Host, strconv.Itoa(cfg.Port))

packet := radius.New(radius.CodeAccessRequest, []byte(cfg.Secret))
usernameAttr, err := radius.NewString(username)
if err != nil {
return nil, nil, err
}
passwordAttr, err := radius.NewString(password)
if err != nil {
return nil, nil, err
}
packet.Add(1, usernameAttr)
packet.Add(2, passwordAttr)
UserName_SetString(packet, username)
UserPassword_SetString(packet, password)
packet.Add(5, radius.NewInteger(uint32(cfg.NasPort)))

client := radius.Client{
Expand Down
Loading

0 comments on commit 86f967b

Please sign in to comment.