token-validator: ssh_access is given through receiveChallenge
This commit is contained in:
parent
847e941b0c
commit
268695563c
2 changed files with 4 additions and 3 deletions
|
@ -351,13 +351,13 @@ func accessibleChallenge(r *http.Request, ps httprouter.Params, _ []byte) (inter
|
|||
}
|
||||
}
|
||||
|
||||
// receiveChallenge treats TP1{shadow} and TP2, TP3 challenges.
|
||||
// receiveChallenge treats TP1{shadow,ssh_access} and TP2, TP3 challenges.
|
||||
func receiveChallenge(r *http.Request, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||
if chid, err := strconv.Atoi(string(ps.ByName("chid"))); err != nil {
|
||||
return nil, err
|
||||
} else if chid < 0 {
|
||||
return nil, errors.New("This challenge doesn't exist")
|
||||
} else if chid != 0 && chid <= len(challenges) {
|
||||
} else if chid != 0 && chid < len(challenges) {
|
||||
return nil, errors.New("This is not the good way to hit this challenge")
|
||||
} else {
|
||||
var gt givenToken
|
||||
|
|
Reference in a new issue