Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Package srp Secure Remote Password protocol

The principal interface provided by this package is the SRP type. The end aim
of the caller is to to have an SRP server and SRP client arrive at the same
of the caller is to have an SRP server and SRP client arrive at the same
key. See the documentation for the SRP structure and its methods for the nitty
gritty of use.

Expand All @@ -27,7 +27,7 @@ the verifier, is known as "v". The verifier is mathematically related to x and i
computed by the client on first enrollment and transmitted to the server.

Typically the server will store the verifier and the client will derive x from a user
secret such as a password. Because the verifier can used like a password hash with
secret such as a password. Because the verifier can be used like a password hash with
respect to cracking, the derivation of x should be designed to resist password cracking
if the verifier is compromised.

Expand All @@ -43,7 +43,7 @@ secrets and can generate a session key, K, which may be used for further encrypt
during the session.

Quoting from http://srp.stanford.edu/design.html (with some modification
for KDF and and checks)
for KDF and checks)

Names and notation
N A large safe prime (N = 2q+1, where q is prime)
Expand Down
2 changes: 1 addition & 1 deletion example_sharedkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Example() {
log.Fatal("Couldn't set up server")
}

// The server will get A (clients ephemeral public key) from the client
// The server will get A (client's ephemeral public key) from the client
// which the server will set using SetOthersPublic

// Server MUST check error status here as defense against
Expand Down
2 changes: 1 addition & 1 deletion hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type srpHash struct {
Sha256Name string

// People will need to read the source if
// the really want to use sha1.
// they really want to use sha1.
sha1Name string
}

Expand Down
8 changes: 4 additions & 4 deletions internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

/*
The principle srp.go file was getting too long, so I'm putting the non-exported
The principal srp.go file was getting too long, so I'm putting the non-exported
methods in here.
*/

Expand All @@ -35,7 +35,7 @@ func (s *SRP) generateMySecret() *big.Int {
return s.ephemeralPrivate
}

// setHashName allows set something other than "sha256". Please don't.
// setHashName allows setting something other than "sha256". Please don't.
// TODO(jpg) Find a way that this can be called before k is computed.
//
//nolint:unused
Expand Down Expand Up @@ -158,7 +158,7 @@ func (s *SRP) isUValid() bool {
return true
}

// makeVerifier creates to the verifier from x and parameters.
// makeVerifier creates the verifier from x and parameters.
func (s *SRP) makeVerifier() (*big.Int, error) {
if s.group == nil {
return nil, fmt.Errorf("group not set")
Expand All @@ -185,7 +185,7 @@ func (s *SRP) calculateU() (*big.Int, error) {
}

// calculateUNonStd creates a hash A and B
// BUG(jpg): Calculation of u does not use RFC 5054 compatable padding/hashing
// BUG(jpg): Calculation of u does not use RFC 5054 compatible padding/hashing
// The scheme we use (see source) is to use SHA256 of the concatenation of A and B
// each represented as a lowercase hexadecimal string.
// Additionally those hex strings have leading "0" removed even if that makes them of odd length.
Expand Down
2 changes: 1 addition & 1 deletion kdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ KDFRFC5054 is *NOT* recommended. Instead use a key derivation function (KDF) tha
involves a hashing scheme designed for password hashing.
The SRP verifier that is stored by the server is like
a password hash with respect to crackability. Choose a KDF
that that makes the server stored verifiers hard to crack.
that makes the server stored verifiers hard to crack.

This computes the client's long term secret, x
from a username, password, and salt as described
Expand Down
2 changes: 1 addition & 1 deletion proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (s *SRP) GoodServerProof(salt []byte, uname string, proof []byte) bool {
return s.isServerProved
}

// ClientProof constructs the clients proof from which it knows the key.
// ClientProof constructs the client's proof from which it knows the key.
func (s *SRP) ClientProof() ([]byte, error) {
if !s.isServer && !s.isServerProved {
return nil, fmt.Errorf("don't construct client proof until server is proved")
Expand Down
2 changes: 1 addition & 1 deletion srp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func TestNewSRPAgainstSpec(t *testing.T) {
var ret *big.Int
var retBytes []byte

// Our calculation of k is not compatable with RFC5054
// Our calculation of k is not compatible with RFC5054
if server.k.Cmp(k) != 0 {
t.Error("Didn't set k, it seems")
}
Expand Down