milleruntime commented on code in PR #2935:
URL: https://github.com/apache/accumulo/pull/2935#discussion_r975558043
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java:
##########
@@ -172,6 +187,45 @@ public void execute(String[] args) throws Exception {
}
}
+ private void printCryptoParams(FSDataInputStream input, Path path) {
+ byte[] magic4 = DfsLogger.LOG_FILE_HEADER_V4.getBytes(UTF_8);
+ byte[] magic3 = DfsLogger.LOG_FILE_HEADER_V3.getBytes(UTF_8);
+ byte[] noCryptoBytes = new NoFileEncrypter().getDecryptionParameters();
+
+ if (magic4.length != magic3.length)
+ throw new AssertionError("Always expect log file headers to be same
length : " + magic4.length
+ + " != " + magic3.length);
+
+ byte[] magicBuffer = new byte[magic4.length];
+ try {
+ input.readFully(magicBuffer);
+ if (Arrays.equals(magicBuffer, magic4)) {
+ byte[] cryptoParams = CryptoUtils.readParams(input);
Review Comment:
I think improvements to the exception handling would be good to look at with
the follow on task "Make CryptoException extend GeneralSecurityException" I
mentioned in #2930
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]