Ver Fonte

lint fixes

Jonathan Turner há 7 anos atrás
pai
commit
3d2f1b3559

+ 2 - 1
credentials/ccache.go

@@ -52,6 +52,7 @@ type principal struct {
 	PrincipalName types.PrincipalName
 }
 
+// Credential holds a Kerberos client's ccache credential information.
 type Credential struct {
 	Client       principal
 	Server       principal
@@ -79,7 +80,7 @@ func LoadCCache(cpath string) (*CCache, error) {
 	return c, err
 }
 
-// ParseCCache byte slice of credential cache data into CCache type.
+// Unmarshal a byte slice of credential cache data into CCache type.
 func (c *CCache) Unmarshal(b []byte) error {
 	p := 0
 	//The first byte of the file always has the value 5

+ 1 - 1
credentials/credentials.go

@@ -50,7 +50,7 @@ type ADCredentials struct {
 	LogonServer         string
 }
 
-// NewCredentials creates a new Credentials instance.
+// New creates a new Credentials instance.
 func New(username string, realm string) *Credentials {
 	uid, err := uuid.GenerateUUID()
 	if err != nil {

+ 1 - 1
gssapi/MICToken.go

@@ -43,7 +43,7 @@ From RFC 4121, section 4.2.6.1:
 const (
 	// MICTokenFlagSentByAcceptor - this flag indicates the sender is the context acceptor.  When not set, it indicates the sender is the context initiator
 	MICTokenFlagSentByAcceptor = 1 << iota
-	// MICTokenFlagSentByAcceptor - this flag indicates confidentiality is provided for.  It SHALL NOT be set in MIC tokens
+	// MICTokenFlagSealed - this flag indicates confidentiality is provided for.  It SHALL NOT be set in MIC tokens
 	MICTokenFlagSealed
 	// MICTokenFlagAcceptorSubkey - a subkey asserted by the context acceptor is used to protect the message
 	MICTokenFlagAcceptorSubkey

+ 3 - 3
gssapi/wrapToken.go

@@ -102,7 +102,7 @@ func (wt *WrapToken) Marshal() ([]byte, error) {
 	return bytes, nil
 }
 
-// ComputeAndSetCheckSum uses the passed encryption key and key usage to compute the checksum over the payload and
+// SetCheckSum uses the passed encryption key and key usage to compute the checksum over the payload and
 // the header, and sets the CheckSum field of this WrapToken.
 // If the payload has not been set or the checksum has already been set, an error is returned.
 func (wt *WrapToken) SetCheckSum(key types.EncryptionKey, keyUsage uint32) error {
@@ -150,7 +150,7 @@ func getChecksumHeader(flags byte, senderSeqNum uint64) []byte {
 	return header
 }
 
-// VerifyCheckSum computes the token's checksum with the provided key and usage,
+// Verify computes the token's checksum with the provided key and usage,
 // and compares it to the checksum present in the token.
 // In case of any failure, (false, Err) is returned, with Err an explanatory error.
 func (wt *WrapToken) Verify(key types.EncryptionKey, keyUsage uint32) (bool, error) {
@@ -208,7 +208,7 @@ func (wt *WrapToken) Unmarshal(b []byte, expectFromAcceptor bool) error {
 	return nil
 }
 
-// NewInitiatorToken builds a new initiator token (acceptor flag will be set to 0) and computes the authenticated checksum.
+// NewInitiatorWrapToken builds a new initiator token (acceptor flag will be set to 0) and computes the authenticated checksum.
 // Other flags are set to 0, and the RRC and sequence number are initialized to 0.
 // Note that in certain circumstances you may need to provide a sequence number that has been defined earlier.
 // This is currently not supported.

+ 1 - 1
keytab/keytab.go

@@ -41,7 +41,7 @@ type principal struct {
 	NameType      int32
 }
 
-// NewKeytab creates new, empty Keytab type.
+// New creates new, empty Keytab type.
 func New() *Keytab {
 	var e []entry
 	return &Keytab{

+ 2 - 2
messages/KDCRep.go

@@ -181,7 +181,7 @@ func (k *ASRep) DecryptEncPart(c *credentials.Credentials) (types.EncryptionKey,
 	return key, nil
 }
 
-// IsValid checks the validity of AS_REP message.
+// Verify checks the validity of AS_REP message.
 func (k *ASRep) Verify(cfg *config.Config, creds *credentials.Credentials, asReq ASReq) (bool, error) {
 	//Ref RFC 4120 Section 3.1.5
 	if k.CName.NameType != asReq.ReqBody.CName.NameType || k.CName.NameString == nil {
@@ -263,7 +263,7 @@ func (k *TGSRep) DecryptEncPart(key types.EncryptionKey) error {
 	return nil
 }
 
-// IsValid checks the validity of the TGS_REP message.
+// Verify checks the validity of the TGS_REP message.
 func (k *TGSRep) Verify(cfg *config.Config, tgsReq TGSReq) (bool, error) {
 	if k.CName.NameType != tgsReq.ReqBody.CName.NameType || k.CName.NameString == nil {
 		return false, krberror.NewErrorf(krberror.KRBMsgError, "CName type in response does not match what was requested. Requested: %+v; Reply: %+v", tgsReq.ReqBody.CName, k.CName)

+ 1 - 1
service/APExchange.go

@@ -8,7 +8,7 @@ import (
 	"gopkg.in/jcmturner/gokrb5.v7/messages"
 )
 
-// ValidateAPREQ validates an AP_REQ sent to the service. Returns a boolean for if the AP_REQ is valid and the client's principal name and realm.
+// VerifyAPREQ verifies an AP_REQ sent to the service. Returns a boolean for if the AP_REQ is valid and the client's principal name and realm.
 func VerifyAPREQ(APReq messages.APReq, s *Settings) (bool, *credentials.Credentials, error) {
 	var creds *credentials.Credentials
 

+ 1 - 1
types/PrincipalName.go

@@ -44,7 +44,7 @@ func (pn PrincipalName) Equal(n PrincipalName) bool {
 	return true
 }
 
-// PrincipalNameString() returns the PrincipalName in string form.
+// PrincipalNameString returns the PrincipalName in string form.
 func (pn PrincipalName) PrincipalNameString() string {
 	return strings.Join(pn.NameString, "/")
 }