Github user ctubbsii commented on a diff in the pull request:
    --- Diff: 
    @@ -81,7 +81,10 @@ private void doKeyEncryptionOperation(int 
encryptionMode, CryptoModuleParameters
           Cipher cipher = 
           try {
    -        cipher.init(encryptionMode, new SecretKeySpec(keyEncryptionKey, 
    +           if (keyEncryptionKey.length > 0)
    --- End diff --
    The original reported issue is that the return value of the read is not 
captured or checked. The conditional being checked here only verifies that the 
allocated array was larger than an empty array. What it actually needs to check 
is that the number of bytes read into the array is the same as the value of the 
length field, regardless of what else we want to check. The conditional in this 
patch is sufficient only if we switch to using `readFully` instead of `read`, 
which throws an EOFException if the number of bytes read from the input stream 
isn't enough to fill the buffer (e.g. doesn't match the expected 

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

Reply via email to