diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f27ba27..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false -language: go -arch: - - amd64 - - ppc64le -go: - - 1.14.x - - 1.15.x - - master diff --git a/README.md b/README.md index 08965e5..7d9edb0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## `twofactor` [![GoDoc](https://godoc.org/github.com/gokyle/twofactor?status.svg)](https://godoc.org/github.com/gokyle/twofactor) -[![Build Status](https://travis-ci.org/gokyle/twofactor.svg?branch=master)](https://travis-ci.org/gokyle/twofactor) + ### Author diff --git a/hotp_test.go b/hotp_test.go index 09e0f6a..2fb65d9 100644 --- a/hotp_test.go +++ b/hotp_test.go @@ -7,10 +7,6 @@ import ( var testKey = []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} -func newZeroHOTP() *HOTP { - return NewHOTP(testKey, 0, 6) -} - var rfcHotpKey = []byte("12345678901234567890") var rfcHotpExpected = []string{ "755224", diff --git a/oath.go b/oath.go index a6d9233..5fb1c83 100644 --- a/oath.go +++ b/oath.go @@ -35,7 +35,7 @@ func (o OATH) Counter() uint64 { } // SetCounter updates the OATH token's counter to a new value. -func (o OATH) SetCounter(counter uint64) { +func (o *OATH) SetCounter(counter uint64) { o.counter = counter } diff --git a/otp_test.go b/otp_test.go index 418baff..412a0b3 100644 --- a/otp_test.go +++ b/otp_test.go @@ -1,8 +1,10 @@ package twofactor -import "fmt" -import "io" -import "testing" +import ( + "fmt" + "io" + "testing" +) func TestHOTPString(t *testing.T) { hotp := NewHOTP(nil, 0, 6) @@ -93,7 +95,7 @@ func TestPaddedURL(t *testing.T) { for i := range urlList { if o, id, err := FromURL(urlList[i]); err != nil { - fmt.Println("hotp: URL should have parsed successfully") + fmt.Println("hotp: URL should have parsed successfully (id=", id, ")") fmt.Printf("\turl was: %s\n", urlList[i]) t.FailNow() fmt.Printf("\t%s, %s\n", o.OTP(), id) diff --git a/totp_test.go b/totp_test.go index f35f719..ef5628f 100644 --- a/totp_test.go +++ b/totp_test.go @@ -44,7 +44,7 @@ var rfcTotpTests = []struct { func TestTotpRFC(t *testing.T) { for _, tc := range rfcTotpTests { - otp := NewTOTP(rfcTotpKey[tc.Algo], 0, 30, 8, tc.Algo) + otp := NewTOTP(rfcTotpKey[tc.Algo], 0, rfcTotpStep, 8, tc.Algo) if otp.otpCounter(tc.Time) != tc.T { fmt.Printf("twofactor: invalid TOTP (t=%d, h=%d)\n", tc.Time, tc.Algo) fmt.Printf("\texpected: %d\n", tc.T)