Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 5.1.2, 5.2.3, 6.0.0 Preview
    • Fix Version/s: 6.0.1 RC
    • Component/s: Application Security
    • Labels:
      None
    • Branch Version/s:
      5.2.x, 5.1.x
    • Backported to Branch:
      Committed
    • Liferay Contributor's Agreement:
      Accept

      Description

      If I have understood correctly following code should produce enc1.equals(enc2) but it doesn't.

      String enc1 = PwdEncryptor.encrypt(PwdEncryptor.TYPE_CRYPT, "test", null);
      String enc2 = PwdEncryptor.encrypt(PwdEncryptor.TYPE_CRYPT, "test", enc1);

        Issue Links

          Activity

          Hide
          ahvenlam Antti Ahvenlampi (Inactive) added a comment - - Restricted to

          Crypt parameters are in wrong order

          Crypt.crypt(clearTextPwd.getBytes(Digester.ENCODING), saltBytes);

          change to this

          Crypt.crypt(saltBytes, clearTextPwd.getBytes(Digester.ENCODING));

          crypt needs only 2 chars extracted for salt

          String salt = cryptString.substring(0, 3);

          change to this

          String salt = cryptString.substring(0, 2);

          Show
          ahvenlam Antti Ahvenlampi (Inactive) added a comment - - Restricted to Crypt parameters are in wrong order Crypt.crypt(clearTextPwd.getBytes(Digester.ENCODING), saltBytes); change to this Crypt.crypt(saltBytes, clearTextPwd.getBytes(Digester.ENCODING)); crypt needs only 2 chars extracted for salt String salt = cryptString.substring(0, 3); change to this String salt = cryptString.substring(0, 2);
          Hide
          brian.chan Brian Chan added a comment -

          Ok, checked it in as you said. Thanks Antti.

          Show
          brian.chan Brian Chan added a comment - Ok, checked it in as you said. Thanks Antti.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 51 weeks, 5 days ago

                Development

                  Subcomponents