Wicket
  1. Wicket
  2. WICKET-260

Wicket uses trivial encryption if com.sun.crypto.provider.SunJCE is not available

    Details

      Description

      The wicket.util.crypt.SunJceCrypt class attempts to load Sun's JCE security provider class and throws an exception if it doesn't exist. Wicket then defaults to a trivial encryption implementation. However, the Java runtime may have other security providers that support the required encryption (PBEWithMD5AndDES). The following patch checks for statically registered providers (which users typically configure in their java.security file) before defaulting to the Sun JCE case.

      Index: src/main/java/wicket/util/crypt/SunJceCrypt.java
      ===================================================================
      — src/main/java/wicket/util/crypt/SunJceCrypt.java (revision 501736)
      +++ src/main/java/wicket/util/crypt/SunJceCrypt.java (working copy)
      @@ -61,6 +61,11 @@
      */
      public SunJceCrypt()
      {
      + if ( Security.getProviders("Cipher."+CRYPT_METHOD).length > 0 )
      +

      { + return; // we are good to go! + }

      +
      try
      {
      // Initialize and add a security provider required for encryption

      1. SunJceCrypt.java.patch
        0.5 kB
        Stuart McCulloch

        Activity

        Hide
        Stuart McCulloch added a comment -

        The proposed patch.

        Show
        Stuart McCulloch added a comment - The proposed patch.
        Hide
        Stuart McCulloch added a comment -

        Bumping up priority, because wicket fails to load the Sun JCE provider on the standard Mac OS X JVM, but with the patch it works.

        Show
        Stuart McCulloch added a comment - Bumping up priority, because wicket fails to load the Sun JCE provider on the standard Mac OS X JVM, but with the patch it works.
        Hide
        Eelco Hillenius added a comment -

        Hmmm, really? I just used Sun JCE on Mac OSX JVM without any problems (but with Wicket 1.3).

        Show
        Eelco Hillenius added a comment - Hmmm, really? I just used Sun JCE on Mac OSX JVM without any problems (but with Wicket 1.3).
        Hide
        Eelco Hillenius added a comment -

        Another thing is that our password field eats up any crypt related exception and says it can't load the crypt, even if there was something completely different going on.

        Show
        Eelco Hillenius added a comment - Another thing is that our password field eats up any crypt related exception and says it can't load the crypt, even if there was something completely different going on.
        Hide
        Martijn Dashorst added a comment -

        Was not fixed in 1.2.5, but will be part of 1.2.6

        Show
        Martijn Dashorst added a comment - Was not fixed in 1.2.5, but will be part of 1.2.6
        Hide
        Martijn Dashorst added a comment -

        Was not fixed in 1.2.5, but will be part of 1.2.6

        Show
        Martijn Dashorst added a comment - Was not fixed in 1.2.5, but will be part of 1.2.6

          People

          • Assignee:
            Martijn Dashorst
            Reporter:
            Stuart McCulloch
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development