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

Changes to CipherInputStream causes BadPaddingException in stable code.

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0_71"
      OpenJDK Runtime Environment (IcedTea 2.5.3) (Arch Linux build 7.u71_2.5.3-1-x86_64)
      OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux tsundere 3.16.4-1-ARCH #1 SMP PREEMPT Mon Oct 6 08:22:27 CEST 2014 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      Changes to CipherInputStream causes BadPaddingException in stable code. Specifically, these lines:

      + } catch (IllegalBlockSizeException | BadPaddingException e) {
      + obuffer = null;
      + throw new IOException(e);
                   }
      - catch (IllegalBlockSizeException e) {obuffer = null;}
      - catch (BadPaddingException e) {obuffer = null;}

      Previously (for 7 years) exceptions were suppressed, now they're not. It causes a lot of troubles with stable software.

      REGRESSION. Last worked in version 7u65

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.7.0_65"
      OpenJDK Runtime Environment (IcedTea 2.5.2) (Arch Linux build 7.u65_2.5.2-3-x86_64)
      OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      14-10-17 20:35 - ERROR - java.io.IOException: javax.crypto.BadPaddingException: Given final block not properly padded
      at javax.crypto.CipherInputStream.close(CipherInputStream.java:321)
      at java.io.PushbackInputStream.close(PushbackInputStream.java:379)
      at com.myJava.file.archive.zip64.InflaterInputStream.close(InflaterInputStream.java:229)
      at com.myJava.file.archive.zip64.ZipInputStream.close(ZipInputStream.java:167)
      at com.myJava.file.driver.event.EventInputStream.close(EventInputStream.java:59)
      at java.util.zip.InflaterInputStream.close(InflaterInputStream.java:227)
      at java.util.zip.GZIPInputStream.close(GZIPInputStream.java:135)
      at com.myJava.file.FileTool.getInputStreamRows(FileTool.java:390)
      at com.application.areca.metadata.AbstractMetadataAdapter.getMetaData(AbstractMetadataAdapter.java:202)
      at com.application.areca.metadata.trace.ArchiveTraceAdapter.traverse(ArchiveTraceAdapter.java:75)
      at com.application.areca.metadata.trace.ArchiveTraceAdapter.traverseTraceFile(ArchiveTraceAdapter.java:166)
      at com.application.areca.impl.AbstractIncrementalFileSystemMedium.buildEntriesMap(AbstractIncrementalFileSystemMedium.java:1964)
      at com.application.areca.impl.AbstractIncrementalFileSystemMedium.recoverImpl(AbstractIncrementalFileSystemMedium.java:1805)
      at com.application.areca.impl.AbstractIncrementalFileSystemMedium.recover(AbstractIncrementalFileSystemMedium.java:1904)
      at com.application.areca.impl.AbstractIncrementalFileSystemMedium.checkArchives(AbstractIncrementalFileSystemMedium.java:380)
      at com.application.areca.impl.FileSystemTarget.processArchiveCheck(FileSystemTarget.java:284)
      at com.application.areca.ActionProxy.processCheckOnTarget(ActionProxy.java:128)
      at com.application.areca.launcher.gui.Application$5.runCommand(Application.java:668)
      at com.application.areca.launcher.gui.Application$ProcessRunner.run(Application.java:1857)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
      at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)
      at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
      at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:420)
      at javax.crypto.Cipher.doFinal(Cipher.java:1805)
      at javax.crypto.CipherInputStream.close(CipherInputStream.java:314)
      ... 19 more

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Downgrade to u65.

        Attachments

          Activity

            People

            • Assignee:
              ascarpino Anthony Scarpino
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: