Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-1373

Encrypted databases cannot be booted using the jar subprotocol (and possibly also using http/https/classpath)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.3.1
    • Fix Version/s: 10.1.3.2, 10.1.3.3, 10.2.1.6
    • Component/s: Store
    • Labels:
      None
    • Environment:
      Environment does not matter.
    • Urgency:
      Normal

      Description

      An encrypted database cannot be booted when using the jar subprotocol.

      The problem lies in the method run from JCECipherFactory. The call to getRandomAccessFile returns null when the verifyKeyFile is an instance of InputStreamFile and the key verification therefore fails.

      The implementation of getRandomAccessFile for InputStreamFile states that its code cannot be reached which is untrue.

      The provided patch does two things, it provides a new class InputStreamRandomAccessFile in package org.apache.derby.impl.io. This class provides simple implementations of readInt and readFully so the key verification process succeeds. A quick scan of the derby source tree showed no problem or possible impact of this simple implementation.

      The second thing the patch does is to modify org/apache/derby/impl/io/InputStreamFile.java so the getRandomAccessFile creates an instance of InputStreamRandomAccessFile instead of returning null.

      This patch has been tested against trunk 410361. It solves the problem at least under the jar subprotocol.

      The patch has not been tested against http/https/classpath.

        Attachments

        1. InputStreamRandomAccessFile.java
          4 kB
          Mathias Herberts
        2. InputStreamFile.java-patch
          0.7 kB
          Mathias Herberts
        3. encryptedJar.patch
          6 kB
          Mathias Herberts
        4. derby1373.stat.txt
          0.5 kB
          Sunitha Kambhampati
        5. derby1373.diff.txt
          14 kB
          Sunitha Kambhampati
        6. 10.1_explicitsvnadd_derby1373.diff.txt
          14 kB
          Sunitha Kambhampati
        7. 10.1_derby1373.diff.txt
          5 kB
          Sunitha Kambhampati

          Activity

            People

            • Assignee:
              herberts Mathias Herberts
              Reporter:
              herberts Mathias Herberts
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: