HBASE-11457 Increment HFile block encoding IVs accounting for cipher's internal use

This commit is contained in:
Andrew Purtell 2014-07-04 10:45:32 -07:00
parent 2416d798fa
commit 94d3dbea86
1 changed files with 3 additions and 1 deletions

View File

@ -187,7 +187,6 @@ public class HFileBlockDefaultEncodingContext implements
Preconditions.checkState(ivLength <= Byte.MAX_VALUE, "IV length out of range");
cryptoByteStream.write(ivLength);
if (ivLength > 0) {
Encryption.incrementIv(iv);
encryptor.setIv(iv);
cryptoByteStream.write(iv);
}
@ -197,6 +196,9 @@ public class HFileBlockDefaultEncodingContext implements
onDiskBytesWithHeader = cryptoByteStream.toByteArray();
// Increment the IV given the final block size
Encryption.incrementIv(iv, 1 + (onDiskBytesWithHeader.length / encryptor.getBlockSize()));
} else {
cryptoByteStream.write(0);