From 93100207b6b2ea59c43270e2fb1fe633dede1915 Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Sat, 7 Jan 2012 14:41:12 -0800 Subject: [PATCH] updated crazy verifier test to chop off last 2 chars from assertion rather than 1, due to base64 resilience that is not worth testing. Fixes #833 --- tests/verifier-test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/verifier-test.js b/tests/verifier-test.js index d0db8a31a..c960717b2 100755 --- a/tests/verifier-test.js +++ b/tests/verifier-test.js @@ -604,9 +604,12 @@ function make_crazy_assertion_tests(new_style) { tok.sign(g_keypair.secretKey), new_style); }, - "and removing the last char from it": { + "and removing the last two chars from it": { topic: function(assertion) { - assertion = assertion.substr(0, assertion.length - 1); + // we used to chop off one char, but because of + // robustness in base64-decoding, that still worked 25% + // of the time. No need to build this knowledge in here. + assertion = assertion.substr(0, assertion.length - 2); wsapi.post('/verify', { audience: TEST_ORIGIN, assertion: assertion -- GitLab