Skip to content

Commit

Permalink
check oid value of krb5 spnego token during unmarshal (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmturner committed Jan 18, 2020
1 parent 8a3a3d7 commit 7c25130
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spnego/krb5Token.go
Expand Up @@ -70,6 +70,9 @@ func (m *KRB5Token) Unmarshal(b []byte) error {
if err != nil {
return fmt.Errorf("error unmarshalling KRB5Token OID: %v", err)
}
if !oid.Equal(gssapi.OID(gssapi.OIDKRB5)) {
return fmt.Errorf("error unmarshalling KRB5Token, OID is %s not %s", oid.String(), gssapi.OID(gssapi.OIDKRB5).String())
}
m.OID = oid
if len(r) < 2 {
return fmt.Errorf("krb5token too short")
Expand Down

0 comments on commit 7c25130

Please sign in to comment.