Skip to content

Commit

Permalink
Fix some codespell issues
Browse files Browse the repository at this point in the history
See,
$ codespell -S ./vendor*,./testenv*,./.git*
  • Loading branch information
mjtrangoni authored and jcmturner committed Nov 11, 2018
1 parent 7dcbe74 commit 1268292
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Expand Up @@ -49,21 +49,21 @@ This would require a minor (v\_.X.\_) version update.
As gokrb5 is designed to be a core library used in other applications it is best to avoid dependencies the project has As gokrb5 is designed to be a core library used in other applications it is best to avoid dependencies the project has
no control over, other than the Go standard library, as issues with any dependency could have large knock on effects. no control over, other than the Go standard library, as issues with any dependency could have large knock on effects.
* Provide useful commit messages. * Provide useful commit messages.
* Pull requests must address one issue only and keep to the scope of the issue. This makes it easier to review and merge, so your contribution will get * Pull requests must address one issue only and keep to the scope of the issue. This makes it easier to review and merge, so your contribution will get
incorporated faster this way. incorporated faster this way.
* Pull requests must have a message obeying this format: * Pull requests must have a message obeying this format:
``` ```
<short summary starting with a verb in lowercase and less than 50 characters> <short summary starting with a verb in lowercase and less than 50 characters>
More detailed explanatory text. This should reference the related issue. More detailed explanatory text. This should reference the related issue.
``` ```
This to adhere to the [git best practice](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project) and This to adhere to the [git best practice](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project) and
mirror the [contribution guidelines for the Go standard libarary](https://golang.org/doc/contribute.html). mirror the [contribution guidelines for the Go standard library](https://golang.org/doc/contribute.html).
An Example: An Example:
``` ```
update to the godoc comments for the function Blah update to the godoc comments for the function Blah
The godoc comments to function subpkg.Blah have been updated to make it The godoc comments to function subpkg.Blah have been updated to make it
clearer as to what the function is for. clearer as to what the function is for.
``` ```


Expand All @@ -74,7 +74,7 @@ A good rule of thumb: The easier you make it for the reader of an issue to help
When raising bugs please include the following items in your issue: When raising bugs please include the following items in your issue:
* The version of gokrb5 being used (vX.Y.Z or master or branch name). * The version of gokrb5 being used (vX.Y.Z or master or branch name).
* The version of Go being used (output of the ```go version``` command is handy). * The version of Go being used (output of the ```go version``` command is handy).
* Details of the environment in which you are seeing the issue. For example, what is being used as the KDC, * Details of the environment in which you are seeing the issue. For example, what is being used as the KDC,
what the krb5.conf contains, etc. what the krb5.conf contains, etc.
* Details on how to re-create the issue. * Details on how to re-create the issue.
* Details on what you are experiencing that indicates the issue. * Details on what you are experiencing that indicates the issue.
Expand All @@ -84,7 +84,7 @@ what the krb5.conf contains, etc.


#### Enhancements #### Enhancements
When raising enhancement requests or suggestions please include the following: When raising enhancement requests or suggestions please include the following:
* What the enhancment is or would do. * What the enhancement is or would do.
* Why you need the enhancement or why you think it would be a good idea. * Why you need the enhancement or why you think it would be a good idea.
* Any suggestions you may have on how to implement. * Any suggestions you may have on how to implement.


Expand All @@ -95,7 +95,7 @@ Running the tests without any particular switches runs only the unit tests.


It is recommended to run tests with the ```-race``` argument. It is recommended to run tests with the ```-race``` argument.


There are integration tests that run against various other network services such as KDCs, HTTP web servers, DNS servers, There are integration tests that run against various other network services such as KDCs, HTTP web servers, DNS servers,
etc. To run these pass ```-tags=integration``` as an argument to the go test command. etc. To run these pass ```-tags=integration``` as an argument to the go test command.
There are vagrant and docker resources available to spin up these network services. See the There are vagrant and docker resources available to spin up these network services. See the
[readme](https://github.com/jcmturner/gokrb5/blob/master/testenv/README.md) in the testenv directory for instructions. [readme](https://github.com/jcmturner/gokrb5/blob/master/testenv/README.md) in the testenv directory for instructions.
2 changes: 1 addition & 1 deletion client/ASExchange.go
Expand Up @@ -14,7 +14,7 @@ import (
// ASExchange performs an AS exchange for the client to retrieve a TGT. // ASExchange performs an AS exchange for the client to retrieve a TGT.
func (cl *Client) ASExchange(realm string, ASReq messages.ASReq, referral int) (messages.ASRep, error) { func (cl *Client) ASExchange(realm string, ASReq messages.ASReq, referral int) (messages.ASRep, error) {
if ok, err := cl.IsConfigured(); !ok { if ok, err := cl.IsConfigured(); !ok {
return messages.ASRep{}, krberror.Errorf(err, krberror.ConfigError, "AS Exchange cannot be preformed") return messages.ASRep{}, krberror.Errorf(err, krberror.ConfigError, "AS Exchange cannot be performed")
} }


b, err := ASReq.Marshal() b, err := ASReq.Marshal()
Expand Down
2 changes: 1 addition & 1 deletion crypto/rfc3961/keyDerivation.go
Expand Up @@ -30,7 +30,7 @@ func DeriveRandom(key, usage []byte, e etype.EType) ([]byte, error) {
out := make([]byte, k/8) out := make([]byte, k/8)


/*If the output of E is shorter than k bits, it is fed back into the encryption as many times as necessary. /*If the output of E is shorter than k bits, it is fed back into the encryption as many times as necessary.
The construct is as follows (where | indicates concatentation): The construct is as follows (where | indicates concatenation):
K1 = E(Key, n-fold(Constant), initial-cipher-state) K1 = E(Key, n-fold(Constant), initial-cipher-state)
K2 = E(Key, K1, initial-cipher-state) K2 = E(Key, K1, initial-cipher-state)
Expand Down
4 changes: 2 additions & 2 deletions gssapi/WrapToken.go
Expand Up @@ -45,7 +45,7 @@ From RFC 4121, section 4.2.6.2:
4.2.4. 4.2.4.
Quick notes: Quick notes:
- "EC" or "Extra Count" refers to the length of the cheksum. - "EC" or "Extra Count" refers to the length of the checksum.
- "Flags" (complete details in section 4.2.2) is a set of bits: - "Flags" (complete details in section 4.2.2) is a set of bits:
- if bit 0 is set, it means the token was sent by the acceptor (generally the kerberized service). - if bit 0 is set, it means the token was sent by the acceptor (generally the kerberized service).
- bit 1 indicates that the token's payload is encrypted - bit 1 indicates that the token's payload is encrypted
Expand Down Expand Up @@ -220,7 +220,7 @@ func NewInitiatorToken(payload []byte, key types.EncryptionKey) (*WrapToken, err


token := WrapToken{ token := WrapToken{
Flags: 0x00, // all zeroed out (this is a token sent by the initiator) Flags: 0x00, // all zeroed out (this is a token sent by the initiator)
// Checksum size: lenth of output of the HMAC function, in bytes. // Checksum size: length of output of the HMAC function, in bytes.
EC: uint16(encType.GetHMACBitLength() / 8), EC: uint16(encType.GetHMACBitLength() / 8),
RRC: 0, RRC: 0,
SndSeqNum: 0, SndSeqNum: 0,
Expand Down
2 changes: 1 addition & 1 deletion gssapi/WrapToken_test.go
Expand Up @@ -186,6 +186,6 @@ func TestMarshal_Failures(t *testing.T) {
func TestNewInitiatorTokenSignatureAndMarshalling(t *testing.T) { func TestNewInitiatorTokenSignatureAndMarshalling(t *testing.T) {
t.Parallel() t.Parallel()
token, tErr := NewInitiatorToken([]byte{0x01, 0x01, 0x00, 0x00}, getSessionKey()) token, tErr := NewInitiatorToken([]byte{0x01, 0x01, 0x00, 0x00}, getSessionKey())
assert.Nil(t, tErr, "Unexepected error.") assert.Nil(t, tErr, "Unexpected error.")
assert.Equal(t, getResponseReference(), token, "Token failed to be marshalled to the expected bytes.") assert.Equal(t, getResponseReference(), token, "Token failed to be marshalled to the expected bytes.")
} }
2 changes: 1 addition & 1 deletion messages/KDCRep.go
Expand Up @@ -166,7 +166,7 @@ func (k *ASRep) DecryptEncPart(c *credentials.Credentials) (types.EncryptionKey,
} }
} }
if !c.HasKeytab() && !c.HasPassword() { if !c.HasKeytab() && !c.HasPassword() {
return key, krberror.NewErrorf(krberror.DecryptingError, "no secret available in credentials to preform decryption of AS_REP encrypted part") return key, krberror.NewErrorf(krberror.DecryptingError, "no secret available in credentials to perform decryption of AS_REP encrypted part")
} }
b, err := crypto.DecryptEncPart(k.EncPart, key, keyusage.AS_REP_ENCPART) b, err := crypto.DecryptEncPart(k.EncPart, key, keyusage.AS_REP_ENCPART)
if err != nil { if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions messages/Ticket.go
Expand Up @@ -139,7 +139,7 @@ func UnmarshalTicketsSequence(in asn1.RawValue) ([]Ticket, error) {
for p < (len(b)) { for p < (len(b)) {
_, err := asn1.UnmarshalWithParams(b[p:], &raw, fmt.Sprintf("application,tag:%d", asnAppTag.Ticket)) _, err := asn1.UnmarshalWithParams(b[p:], &raw, fmt.Sprintf("application,tag:%d", asnAppTag.Ticket))
if err != nil { if err != nil {
return nil, fmt.Errorf("unmarshaling sequence of tickets failed geting length of ticket: %v", err) return nil, fmt.Errorf("unmarshaling sequence of tickets failed getting length of ticket: %v", err)
} }
t, err := UnmarshalTicket(b[p:]) t, err := UnmarshalTicket(b[p:])
if err != nil { if err != nil {
Expand All @@ -166,7 +166,7 @@ func MarshalTicketSequence(tkts []Ticket) (asn1.RawValue, error) {
for i, t := range tkts { for i, t := range tkts {
b, err := t.Marshal() b, err := t.Marshal()
if err != nil { if err != nil {
return raw, fmt.Errorf("error marshaling ticket number %d in seqence of tickets", i+1) return raw, fmt.Errorf("error marshaling ticket number %d in sequence of tickets", i+1)
} }
btkts = append(btkts, b...) btkts = append(btkts, b...)
} }
Expand Down

0 comments on commit 1268292

Please sign in to comment.