lib2fa

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbFlag map[string]bool
View Source
var OracleURL string

Functions

func GetCurrent2fa

func GetCurrent2fa(userHash string) (a2faPin string, ttl int, err error)

GetCurrent2fa() gets the current 2fa key using the random oracle and the per-user hash.

func GetRandomFormOracle

func GetRandomFormOracle() (s string, ttl int, err error)

func GetUserHash

func GetUserHash(user_id string) (hv string, err error)

GetUserHash Get the unique hash ID for the specified user.

func GetValid2faList

func GetValid2faList(user_id string) (list []string, key map[string]bool, err error)

GetValidList get list of convened to string int values for valid 2fa

func IsValid2faPin

func IsValid2faPin(pin, user_id string) (ok bool)

IsValid2faPin returns true if the passed pin is verhoff compliant and the value is a valid 2fa key for this user. If the pin is a otk - then it will be marked as used and no longer avalable for use.

func Setup

func Setup(u string, d map[string]bool, fp *os.File)

func ValidateChecksum

func ValidateChecksum(s string) bool

Types

type OracleData

type OracleData struct {
	Status string `json:"status"`
	Value  string `json:"value"`
	TTL    int    `json:"ttl"`
}

Jump to

Keyboard shortcuts

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