HBASE-11457 Increment HFile block encoding IVs accounting for cipher's internal use
This commit is contained in:
parent
0b692dfd5a
commit
f36bf219ec
|
@ -187,7 +187,6 @@ public class HFileBlockDefaultEncodingContext implements
|
||||||
Preconditions.checkState(ivLength <= Byte.MAX_VALUE, "IV length out of range");
|
Preconditions.checkState(ivLength <= Byte.MAX_VALUE, "IV length out of range");
|
||||||
cryptoByteStream.write(ivLength);
|
cryptoByteStream.write(ivLength);
|
||||||
if (ivLength > 0) {
|
if (ivLength > 0) {
|
||||||
Encryption.incrementIv(iv);
|
|
||||||
encryptor.setIv(iv);
|
encryptor.setIv(iv);
|
||||||
cryptoByteStream.write(iv);
|
cryptoByteStream.write(iv);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +196,9 @@ public class HFileBlockDefaultEncodingContext implements
|
||||||
|
|
||||||
onDiskBytesWithHeader = cryptoByteStream.toByteArray();
|
onDiskBytesWithHeader = cryptoByteStream.toByteArray();
|
||||||
|
|
||||||
|
// Increment the IV given the final block size
|
||||||
|
Encryption.incrementIv(iv, 1 + (onDiskBytesWithHeader.length / encryptor.getBlockSize()));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
cryptoByteStream.write(0);
|
cryptoByteStream.write(0);
|
||||||
|
|
Loading…
Reference in New Issue