Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4222

CryptoMapper - Error decoding text, exception thrown for links in markup

    XMLWordPrintableJSON

    Details

      Description

      When CryptoMapper is used an exception is thrown for any links in the page markup such as images and stylesheets.

      Can be replicate with this init() and a standard quickstart.
      public void init() {
      super.init();
      getSecuritySettings().setCryptFactory(new KeyInSessionSunJceCryptFactory());
      setRootRequestMapper(new CryptoMapper(getRootRequestMapper(), this));
      }

      HomePage.html
      <img src="logo.png" width="50px" height="50px" alt="Wicket Logo" />

      ERROR - AbstractCrypt - Error decoding text: logo.png
      java.lang.RuntimeException: Unable to decrypt the text '??(?x'
      at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:150)
      at org.apache.wicket.util.crypt.AbstractCrypt.decryptUrlSafe(AbstractCrypt.java:66)
      at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:159)
      at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
      at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
      ..snip
      Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
      at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
      at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
      at com.sun.crypto.provider.SunJCE_ab.b(DashoA13*..)
      at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(DashoA13*..)
      at javax.crypto.Cipher.doFinal(DashoA13*..)
      at org.apache.wicket.util.crypt.SunJceCrypt.crypt(SunJceCrypt.java:94)
      at org.apache.wicket.util.crypt.AbstractCrypt.decryptByteArray(AbstractCrypt.java:146)
      ... 32 more
      ERROR - CryptoMapper - Error decrypting URL
      java.lang.IllegalArgumentException: Argument 'url' may not be null.
      at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
      at org.apache.wicket.request.Url.parse(Url.java:127)
      at org.apache.wicket.request.mapper.CryptoMapper.decryptUrl(CryptoMapper.java:160)
      at org.apache.wicket.request.mapper.CryptoMapper.mapRequest(CryptoMapper.java:102)
      at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:181)
      at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:206)
      at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
      at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)

        Attachments

        1. cryptoMapperQs.tgz
          28 kB
          Phill Ashworth
        2. cryptoMapperQs2.tgz
          36 kB
          Phill Ashworth

          Activity

            People

            • Assignee:
              ivaynberg Igor Vaynberg
              Reporter:
              leadseeker Phill Ashworth
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: