auth

package
v0.0.0-...-0763949 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationFailedEvent

type AuthenticationFailedEvent struct {
	Result steamprotocol.EResult
}

AuthenticationFailedEvent is fired when failed CMsgClientLogonResponse is received.

type Details

type Details struct {
	Username     string
	Password     string
	AuthCode     string
	SharedSecret string
}

Details used to auth user

type LoggedOffEvent

type LoggedOffEvent struct {
	Result steamprotocol.EResult
}

LoggedOffEvent is fired when steam log off authenticated client.

type MachineAuthUpdateEvent

type MachineAuthUpdateEvent struct {
	Hash []byte
}

MachineAuthUpdateEvent is fired when CMsgClientUpdateMachineAuth is received.

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module used to auth user.

The general gist of a Steam sign on is: ChannelEncryptRequest (server->client): The server is asking a user to negotiate

encryption on the specified universe.

ChannelEncryptResponse (client->server): The client generates a key and encrypts

it with the universe public key. The specifics are in the implementation.

ChannelEncryptResult (server->client): EResult of whether the negotiation was successful. ClientLogOn (client->server): Log on to service. Described in Steam and implementation. Multi (meta message, server->client): Server sent multiple messages, decompress and process, see implementation. ClientLogOnResponse (server->client): EResult of logon, as well as the authoritative steam id,

session ID (needs to be in every message header like steamid), and the heartbeat interval.
Every message after ClientLogOn needs the steamid and sessionID set in the header

ClientGetAppOwnershipTicket (client->server): Client normally requests winui (appid 7) ownership ticket. ClientGetAppOwnershipTicketResponse (server->client): response to the above request,

returns the ownership ticket for the request appid , or an error EResult.

ClientAccountInfo/EmailInfo/VACBanStatus (server->client): Account info ClientFriendsList (server->client): List of friends by steam id. The readable info is sent in PersonaStates. ClientLicenseList (server->client): List of licenses, which correspond to subs. ClientAuthList (client->server): Request a batch of game connect tokens from Steam ClientGameConnectTokens (server->client): Game connect tokens (see topicof tokens/tickets) ClientSessionToken (server->client): Used for something! ClientCMList (server->client): Authoritive list of CM servers,

for clients that use the bootstrap list of CM servers. CM servers are Steam servers.

ClientHeartBeat (client->server): Heartbeat sent to server to signal connection is alive.

Sent every few seconds, as specified in the LogOnResponse message.

func NewModule

func NewModule(
	cl *steamprotocol.Client,
	eventManager *steamprotocol.EventManager,
	gen *TOTPGenerator,
	details Details,
) *Module

NewModule initialize new instance of auth Module.

func (*Module) Subscribe

func (m *Module) Subscribe()

Subscribe used to start listen event and packets from eventManager.

type NewLoginKeyAcceptedEvent

type NewLoginKeyAcceptedEvent struct {
	UniqID uint32
	Key    string
}

NewLoginKeyAcceptedEvent is fired when CMsgClientNewLoginKey is received.

type SuccessfullyAuthenticatedEvent

type SuccessfullyAuthenticatedEvent struct {
	Heartbeat time.Duration
	SteamID   uint64
	SessionID int32
}

SuccessfullyAuthenticatedEvent is fired when successful CMsgClientLogonResponse is received.

type TOTPGenerator

type TOTPGenerator struct {
	// contains filtered or unexported fields
}

TOTPGenerator is used to generate two factor auth code synced by time with Steam. TOTP = Time-based One-time Password Algorithm

func NewTOTPGenerator

func NewTOTPGenerator(cl *http.Client) *TOTPGenerator

NewTOTPGenerator initialize new instance of TOTPGenerator

func (*TOTPGenerator) FetchTimeTip

func (gen *TOTPGenerator) FetchTimeTip() (*TimeTip, error)

FetchTimeTip fetch time from Steam.

func (*TOTPGenerator) GenerateTwoFactorCode

func (gen *TOTPGenerator) GenerateTwoFactorCode(sharedSecret string, currentTimestamp int64) (string, error)

GenerateTwoFactorCode generate Steam two-factor code using current timestamp as parameter.

func (*TOTPGenerator) TwoFactorSynced

func (gen *TOTPGenerator) TwoFactorSynced(sharedSecret string) (string, error)

TwoFactorSynced fetch time from Steam and return generated two-factor code synced by time with Steam

type TimeTip

type TimeTip struct {
	Time                              int64  `json:"server_time,string"`
	SkewToleranceSeconds              uint32 `json:"skew_tolerance_seconds,string"`
	LargeTimeJink                     uint32 `json:"large_time_jink,string"`
	ProbeFrequencySeconds             uint32 `json:"probe_frequency_seconds"`
	AdjustedTimeProbeFrequencySeconds uint32 `json:"adjusted_time_probe_frequency_seconds"`
	HintProbeFrequencySeconds         uint32 `json:"hint_probe_frequency_seconds"`
	SyncTimeout                       uint32 `json:"sync_timeout"`
	TryAgainSeconds                   uint32 `json:"try_again_seconds"`
	MaxAttempts                       uint32 `json:"max_attempts"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL