Commit Graph

16 Commits

Author SHA1 Message Date
c8ef25b018 use filepath to join the path to the csv file
this ensures `\` on the path on windows
2022-06-15 22:43:46 +02:00
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
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
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
3e14d15f54 Clean up output formatting code.
Instead of manually computing column sizes, use the tabwriter library package.
The output is the same, but requires less fiddly space manipulation.
2019-06-02 08:23:28 -07:00
87aa5234c1 Separate OTP generation into a library.
No functional changes are intended; the main package now imports the library
and uses it, but the implementation is unchanged.

Specific highlights:

- Change the names of the functions to avert stutter following the advice of
  Effective Go: https://golang.org/doc/effective_go.html#package-names

- Reorganize the helpers in main so control flow is easier to follow.

- Add documentation comments.
2019-06-01 18:07:27 -07:00
e16e5ca533 Better aligment (#17) 2019-06-02 00:03:23 +02:00
64a70580db Adding windows support (#22) 2019-06-02 00:02:45 +02:00
65ebfe1593 newline after terminal.ReadPassword
Closes issue #5.
2015-12-07 21:21:31 +00:00
08c36af51e fix encryption
- moving to crypto/ssh/terminal, which should also work on Windows
  and be better maintained (code.google.com is going away)
- fix support for padding

Closes #2.
2015-12-03 18:21:57 +00:00
bc0fc1991e fix for travis complaint 2014-02-26 20:12:10 -08:00
88535c8fbe support for encryption 2013-11-21 19:17:19 -08:00
efee605b1d move to CSV
Preserves order, easier to maintain, more Unixy, less error-prone.
Sorry if you have to migrate.
2013-11-14 03:18:38 -08:00
5bc8ff087a Support for "irregular" secret lengths
I realized whilst turning 2FA for Dropbox that they use a secret length
that's not a multiplier of 8, which breaks Go's base32 decoder.
2013-11-14 02:29:27 -08:00
0df57e2c2e gauth.go: header, progress bar 2013-11-14 01:17:19 -08:00
c1e9da57d1 make it a local process... HTTP is too much pain
Adapting to my new workflow, yo.
2013-11-12 06:45:56 +00:00