Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8157603

TestCipher.java doesn't check one of the decrypted message as expected

    Details

    • Subcomponent:
    • Introduced In Build:
      b81
    • Introduced In Version:
      9
    • Resolved In Build:
      b123

      Backports

        Description

        In this file:
        http://hg.openjdk.java.net/jdk9/dev/jdk/file/0b2d0cf231c7/test/com/sun/crypto/provider/Cipher/TestCipher.java

        Decryption is performed into INPUT_TEXT (lines 194-197).

                // Recover text from cipher and save to same buffer
                ci.update(INPUT_TEXT, STORAGE_OFFSET, TEXT_LEN + PAD_LEN, INPUT_TEXT,
                        ENC_OFFSET);
                ci.doFinal(INPUT_TEXT, ENC_OFFSET);

        But check that decryption went well is performed on another buffer - recoveredText (lines 199 -206):

                if (!equalsBlock(
                        plainText, ENC_OFFSET, recoveredText, 0,
                        recoveredText.length)) {
                    throw new RuntimeException(
                            "Recovered text not same as plain text with same buffer");
                } else {
                    out.println("Recovered and plain text are same with same buffer");
                }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  akosarev Artem Kosarev (Inactive)
                  Reporter:
                  akosarev Artem Kosarev (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: