5 Commits

Author SHA1 Message Date
M. J. Fromberger
f5a1f722c0 Proposal: Extend configuration file format to support options.
This change is a follow-up to the discussion on #33, which proposes a
backward-compatible extension to the existing config file format to allow the
user to include otpauth URLs in addition to the standard format.

This is WIP, not ready to merge; it needs tests and a better story for the
progress indicator.
2021-03-11 07:15:38 -05:00
M. J. Fromberger
c57414b83b
Fix padding removal when decrypting a config file. (#36)
OpenSSL uses PKCS#5 padding, and the decryption code was not removing it
correctly. In some cases, this causes the last line of the decrypted config to
be mangled and produces invalid results.

To support this:

- Move config loading to gauth.LoadConfigFile.
- Inject a hook to read the user's password.
- Add unit tests that decryption doesn't corrupt the result.
- Update module dependencies.
- Update Go versions in CI, and fix some config-check warnings.
2020-10-26 18:42:15 -07:00
M. J. Fromberger
02ea9924ea Update otp module path to github.
No functional changes here; I'm just moving the source repository from
bitbucket to github and need to update the import path accordingly.
2019-06-10 10:12:34 -07:00
M. J. Fromberger
9d95eb95fd Consolidate and simplify the generation of codes.
Rework gauth.Code as gauth.Codes, which returns the previous, current, and next
strings in one step. Remove authCodeOrDie, since there is now only one decode
step to check.

The implementation now uses the bitbucket.org/creachadair/otp package, which
makes the code simpler and subsumes normalizeSecret.
2019-06-03 22:20:08 -07:00
M. J. Fromberger
0d0c6c886e Add go.mod and go.sum files to support Go modules. 2019-06-01 18:07:27 -07:00