accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-3220) Division by zero if encryption cipher isn't a block cipher
Date Fri, 10 Oct 2014 18:01:34 GMT

    [ https://issues.apache.org/jira/browse/ACCUMULO-3220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14167218#comment-14167218
] 

Josh Elser commented on ACCUMULO-3220:
--------------------------------------

bq. I'm not sure if we can support non-block ciphers because we need to have the ability to
control end-of-cipher for data integrity

Hence the RTE :)

> Division by zero if encryption cipher isn't a block cipher
> ----------------------------------------------------------
>
>                 Key: ACCUMULO-3220
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-3220
>             Project: Accumulo
>          Issue Type: Sub-task
>    Affects Versions: 1.6.0, 1.6.1
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>            Priority: Minor
>              Labels: coverity
>             Fix For: 1.6.2, 1.7.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:title=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);
>   }
> {code}
> If the Cipher is not a block cipher, blocksize is zero and would result in a division
by zero error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message