Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1865

ChecksumCalculator getSha1 does not compute checksums correctly

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-M6
    • Component/s: None
    • Labels:
      None

      Description

      ChecksumCalculator does the following in getSha1:

      md.update( configValue.getBytes( ISO_8859_1 ), 0, configValue.length() );
      

      This isn't using the right length, because configValue.length() is a length in characters, not bytes. This will lead to the wrong length being used for any strings that contain characters that aren't encoded in a single byte.

      Additionally, I believe that this class can be used to compute checksums on strings that fall outside the ISO_8859_1 character set, so UTF_8 would be a better choice.

      I ran into this when defining a test property that contained Cyrillic characters and emojis.

        Attachments

          Activity

            People

            • Assignee:
              tibordigana Tibor Digana
              Reporter:
              gian Gian Merlino

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment