Github user interma commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1274#discussion_r131583257
--- Diff: depends/libhdfs3/src/client/CryptoCodec.cpp ---
@@ -119,33 +119,38 @@ namespace Hdfs {
return -1;
}
- //calculate new IV when appending a existed file
+ // Calculate iv and counter in order to init cipher context
with cipher method. Default value is 0.
+ resetStreamOffset(crypto_method, stream_offset);
+
+ LOG(DEBUG3, "CryptoCodec init success, length of the decrypted
key is : %llu, crypto method is : %d", AlgorithmBlockSize, crypto_method);
+ is_init = true;
+ return 1;
+
+ }
+
+ int CryptoCodec::resetStreamOffset(CryptoMethod crypto_method, int64_t
stream_offset) {
+ // Calculate new IV when appending an existed file.
--- End diff --
check `is_init`: if not initialized yet, return -1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---