aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTad Fisher <tad@simple.com>2017-03-19 20:58:45 -0700
committerTad Fisher <tad@simple.com>2017-03-19 20:58:45 -0700
commit698ae45a780bcc83d8dadc18aadfb049ec7c127c (patch)
tree146beb2690007dd35aef6cf2e70eaf7bee59c96f /test
parentd29b61248c87ab29283eb4ccbd037869f0b4df28 (diff)
downloadpass-otp-698ae45a780bcc83d8dadc18aadfb049ec7c127c.tar.gz
pass-otp-698ae45a780bcc83d8dadc18aadfb049ec7c127c.zip
Fix HOTP URI parsing
Diffstat (limited to 'test')
-rwxr-xr-xtest/insert.t2
-rwxr-xr-xtest/validate.t4
2 files changed, 5 insertions, 1 deletions
diff --git a/test/insert.t b/test/insert.t
index eb04898..228a8ec 100755
--- a/test/insert.t
+++ b/test/insert.t
@@ -67,7 +67,7 @@ test_expect_success 'Commits insert to git' '
test_pass_init &&
pass git init &&
"$PASS" otp insert totp -s AAAAAAAAAAAAAAAAAAAAA passfile &&
- git log --no-decorate -1 | grep "Add given OTP secret for passfile to store."
+ git log --no-decorate -1 | grep "Add OTP secret for passfile to store."
'
test_done
diff --git a/test/validate.t b/test/validate.t
index 9fbe66c..6d05fdf 100755
--- a/test/validate.t
+++ b/test/validate.t
@@ -12,6 +12,10 @@ test_expect_success 'Parses a complex TOTP URI' '
"$PASS" otp validate otpauth://totp/ACME%20Co:john.doe@email.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30
'
+test_expect_success 'Parses a basic HOTP URI' '
+ "$PASS" otp validate "otpauth://hotp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&counter=10&issuer=Example"
+'
+
test_expect_success 'Fails for bogus URL' '
test_must_fail "$PASS" otp validate https://www.google.com/
'