Uploaded image for project: 'Jetspeed (Retired)'
  1. Jetspeed (Retired)
  2. JS1-419

[FIX] TurbineUserManagement - encryptPassword() - Stream not flushed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.4b4
    • 1.5
    • Security
    • None
    • Operating System: All
      Platform: All
    • 24752

    Description

      In org.apache.jetspeed.services.security.turbine.TurbineUserManagement
      in Method encryptPassword() the OutputStream is not flushed.

      The result is that the returned encrypted passwordstring is not complete and i
      think it may vary on different systems.

      /* CODE from current CVS: */
      MessageDigest md = MessageDigest.getInstance(passwordsAlgorithm);
      byte[] digest = md.digest(password.getBytes("UTF-8"));
      ByteArrayOutputStream bas = new ByteArrayOutputStream(digest.length +
      digest.length / 3 + 1);
      OutputStream encodedStream = MimeUtility.encode(bas, "base64");
      encodedStream.write(digest);
      return bas.toString();

      /* FIX: */
      encodedStream.flush();

      Attachments

        Activity

          People

            Unassigned Unassigned
            kkf@guso.de Florian Kamke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: