Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SteamGuard authentication #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tschwery
Copy link

A new optional column is read in the CSV file to specify with which TOTP the line must be computed.

The implementation is based on the work done in the SailOTP application available on https://github.com/seiichiro0185/sailotp

A new optional column is read in the CSV file to specify with which TOTP
the line must be computed.

The implementation is based on the work done in the SailOTP application
available on github.com/seiichiro0185/sailotp
Base automatically changed from master to main January 29, 2021 03:02
@pcarrier
Copy link
Owner

pcarrier commented Jan 29, 2021

Sorry for the crazy lag, no excuse. Nice contribution, if you'd like to rebase happy to reconsider for a merge, otherwise might steal later.

@@ -57,12 +58,28 @@ func AuthCode(sec string, ts int64) (string, error) {
offset := hash[19] & 0x0f
trunc := hash[offset : offset+4]
trunc[0] &= 0x7F
res := new(big.Int).Mod(new(big.Int).SetBytes(trunc), big.NewInt(1000000))
return fmt.Sprintf("%06d", res), nil
if strings.TrimSpace(encodeType) == "Steam" {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: case-insensitive seems better?

@creachadair
Copy link
Collaborator

FWIW, if you do want to go ahead with this change, I added an extension point to the otp package to allow overriding the rendering alphabet (example).

That should make it a little easier to integrate with code generation. This is also tangentially related to #33 in that it requires extending the config format. (One idea: A provider of steam could trigger the alternative alphabet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants