Documentation ¶
Overview ¶
The go-srp/srpserver package contains server-side utilities necessary to implement SRP v. 6a, as described here: http://srp.stanford.edu/design.html It aims to be a generalized implementation for use with various hash functions and key/salt sizes.
Index ¶
- func H(to_hash, salt []byte) big.Int
- func Pad(length int, src []byte) []byte
- func RandomBytes(slen uint) (big.Int, error)
- type ChallengeResponse
- type EmptyUsernameError
- type ErrNoPrimeAvailable
- type ErrorShortBytes
- type ErrorUninitializedSRPConfig
- type SRPClientSession
- type SRPConfig
- type SRPGroupParameters
- type SRPSession
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChallengeResponse ¶
type EmptyUsernameError ¶
type EmptyUsernameError int
func (*EmptyUsernameError) Error ¶
func (e *EmptyUsernameError) Error() string
type ErrNoPrimeAvailable ¶
type ErrNoPrimeAvailable int
func (ErrNoPrimeAvailable) Error ¶
func (e ErrNoPrimeAvailable) Error() string
type ErrorShortBytes ¶
type ErrorShortBytes struct {
// contains filtered or unexported fields
}
func (ErrorShortBytes) Error ¶
func (e ErrorShortBytes) Error() string
type ErrorUninitializedSRPConfig ¶
type ErrorUninitializedSRPConfig string
func (ErrorUninitializedSRPConfig) Error ¶
func (e ErrorUninitializedSRPConfig) Error() string
type SRPClientSession ¶
type SRPClientSession struct {
// contains filtered or unexported fields
}
func (*SRPClientSession) New ¶
func (s *SRPClientSession) New(i string, config *SRPConfig) (*SRPClientSession, error)
type SRPConfig ¶
type SRPConfig struct {
// contains filtered or unexported fields
}
type SRPGroupParameters ¶
func GetGroupParameters ¶
func GetGroupParameters(Nsize int) (SRPGroupParameters, error)
Takes the size in bits of the desired prime number, and returns an SRPGroupParameters object with the prime and the generator.
type SRPSession ¶
type SRPSession struct {
// contains filtered or unexported fields
}
func (*SRPSession) ChallengeResponse ¶
func (s *SRPSession) ChallengeResponse() (string, error)
func (*SRPSession) New ¶
func (s *SRPSession) New(v Verifier, config *SRPConfig) (*SRPSession, error)
func (*SRPSession) ReadChallenge ¶
func (s *SRPSession) ReadChallenge(jsonIA string) error
type Verifier ¶
func (*Verifier) New ¶
Create an SRP verifier, given a password p, and the length of the desired salt, a hash function, and a salt generating function. This is the DIY version of Verifier.New() Note: does NOT take a function that generates a hash.Hash, because this would preclude doing things like pbkdf2, which takes the password and salt and deals with them separately. The function handed to this should be a wrapper function that takes the password and salt as its 1st and 2nd argument respectively.