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.
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.
- 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.