X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Faccount%2FTestCertificateAdd.java;h=854cca7a54ba16daabdf64b5c730c4e63da50471;hp=9b3a7638cd9125dbf6acea1fe6df0dbd69a01488;hb=7fdcb19d8efdad5839f56d0c95028cad0460da3d;hpb=bccd4cc0dba0f89aa045b113bac46eb8cc1dab4e diff --git a/tests/club/wpia/gigi/pages/account/TestCertificateAdd.java b/tests/club/wpia/gigi/pages/account/TestCertificateAdd.java index 9b3a7638..854cca7a 100644 --- a/tests/club/wpia/gigi/pages/account/TestCertificateAdd.java +++ b/tests/club/wpia/gigi/pages/account/TestCertificateAdd.java @@ -289,7 +289,7 @@ public class TestCertificateAdd extends ClientTest { return uc; } - protected String testSPKAC(boolean correctChallange) throws GeneralSecurityException, IOException { + protected String testSPKAC(boolean correctChallenge) throws GeneralSecurityException, IOException { HttpURLConnection uc = (HttpURLConnection) ncert.openConnection(); uc.setRequestProperty("Cookie", cookie); String s = IOUtils.readURL(uc); @@ -297,13 +297,13 @@ public class TestCertificateAdd extends ClientTest { csrf = extractPattern(s, Pattern.compile("]*name='csrf' [^>]*value='([^']*)'>")); String challenge = extractPattern(s, Pattern.compile("]*name=\"SPKAC\" [^>]*challenge=\"([^\"]*)\"/>")); - SPKAC spk = new SPKAC((X509Key) kp.getPublic(), challenge + (correctChallange ? "" : "b")); + SPKAC spk = new SPKAC((X509Key) kp.getPublic(), challenge + (correctChallenge ? "" : "b")); Signature sign = Signature.getInstance("SHA512WithRSA"); sign.initSign(kp.getPrivate()); try { String[] res = fillOutFormDirect("SPKAC=" + URLEncoder.encode(Base64.getEncoder().encodeToString(spk.getEncoded(sign)), "UTF-8")); - if ( !correctChallange) { - fail("Should not succeed with wrong challange."); + if ( !correctChallenge) { + fail("Should not succeed with wrong challenge."); } assertArrayEquals(new String[] { "client", CertificateRequest.DEFAULT_CN, "", Digest.SHA512.toString()