hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [4/6] git commit: HBASE-11457 Increment HFile block encoding IVs accounting for cipher's internal use
Date Fri, 04 Jul 2014 17:51:54 GMT
HBASE-11457 Increment HFile block encoding IVs accounting for cipher's internal use


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/f36bf219
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f36bf219
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f36bf219

Branch: refs/heads/branch-1
Commit: f36bf219ec7827eaef251cac94253d50acf2c1ae
Parents: 0b692df
Author: Andrew Purtell <apurtell@apache.org>
Authored: Fri Jul 4 10:45:32 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Jul 4 10:49:03 2014 -0700

----------------------------------------------------------------------
 .../hbase/io/encoding/HFileBlockDefaultEncodingContext.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/f36bf219/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java
b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java
index 0dc1c8a..7dfe857 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/HFileBlockDefaultEncodingContext.java
@@ -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);


Mime
View raw message