HBASE-11457 Increment HFile block encoding IVs accounting for cipher's internal use
This commit is contained in:
parent
2416d798fa
commit
94d3dbea86
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue