Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-3219 Review Coverity
  3. ACCUMULO-3220

Division by zero if encryption cipher isn't a block cipher

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0, 1.6.1
    • Fix Version/s: 1.6.2, 1.7.0
    • Component/s: None
    • Labels:

      Description

      BlockedOutputStream.java
        public BlockedOutputStream(OutputStream out, int blockSize, int bufferSize) {
          if (bufferSize <= 0)
            throw new IllegalArgumentException("bufferSize must be greater than 0.");
          if (out instanceof DataOutputStream)
            this.out = (DataOutputStream) out;
          else
            this.out = new DataOutputStream(out);
          this.blockSize = blockSize;
          int remainder = bufferSize % blockSize;
          if (remainder != 0)
            remainder = blockSize - remainder;
          // some buffer space + bytes to make the buffer evened up with the cipher block size - 4 bytes for the size int
          bb = ByteBuffer.allocate(bufferSize + remainder - 4);
        }
      

      If the Cipher is not a block cipher, blocksize is zero and would result in a division by zero error.

        Attachments

          Activity

            People

            • Assignee:
              elserj Josh Elser
              Reporter:
              elserj Josh Elser
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m