Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Implemented
-
1.4.0
Description
LiveFileMetaData class in RocksDB has three methods that are returning a byte[] which we convert to String after any call.
These methods are:
- columnFamilyName()
- smallestKey()
- largestKey()
We use 3 different conversion to String for the returned byte arrays.
For largestKey and smallestKey we use FixedLengthStringCodec.bytes2String and new String(byte[], UTF_8)
For columnFamilyName we use org.apache.hadoop.hdds.StringUtils.bytes2String, new String(byte[], UTF_8), and org.bouncycastle.util.Strings.fromByteArray.
From these methods, FixedLengthStringCodec throws an exception if the conversion can not be done, and it uses ISO_8859_1 as the charset for the conversion, while the rest uses UTF_8 charset for the conversion, and replaces the characters that UTF-8 can not represent.
Based on how and where we use these it seems to be safe to settle on UTF-8 as the target charset, and use StringUtils.bytes2String from our own utilities which uses the String constructor as of now by the way.
Removing org.bouncycastle.util.Strings usage is also beneficial for crypto compliance related development.
Attachments
Issue Links
- blocks
-
HDDS-10743 Turn the direct dependency on BouncyCastle to an optional one
- Open
- is related to
-
HDDS-10234 Regulatory compliance for used cryptography
- Open
- links to