Commit Graph

13 Commits

Author SHA1 Message Date
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