hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [6/6] git commit: HBASE-11457 Increment HFile block encoding IVs accounting for cipher's internal use
Date Fri, 04 Jul 2014 17:51:56 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/f348aa71
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/f348aa71
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/f348aa71

Branch: refs/heads/0.98
Commit: f348aa719975e64ae5a6d349ca304fe77aa41b5c
Parents: 624a66e
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:50:25 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/f348aa71/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 8386377..98581cc 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
@@ -206,7 +206,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);
         }
@@ -216,6 +215,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