You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org> on 2014/07/23 08:32:38 UTC

[jira] [Created] (HDFS-6737) DFSClinet should use IV generated beased on the configured CipherSuite with codecs used

Uma Maheswara Rao G created HDFS-6737:
-----------------------------------------

             Summary: DFSClinet should use IV generated beased on the configured CipherSuite with codecs used
                 Key: HDFS-6737
                 URL: https://issues.apache.org/jira/browse/HDFS-6737
             Project: Hadoop HDFS
          Issue Type: Sub-task
          Components: hdfs-client
    Affects Versions: fs-encryption (HADOOP-10150 and HDFS-6134)
            Reporter: Uma Maheswara Rao G
            Assignee: Uma Maheswara Rao G


Seems like we are using IV as like Encrypted data encryption key iv. But the underlying Codec's cipher suite may expect different iv length. So, we should generate IV from the Coec's cipher suite configured.

{code}
 final CryptoInputStream cryptoIn =
          new CryptoInputStream(dfsis, CryptoCodec.getInstance(conf, 
              feInfo.getCipherSuite()), feInfo.getEncryptedDataEncryptionKey(),
              feInfo.getIV());
{code}

So, instead of using feinfo.getIV(), we should generate like

{code}
byte[] iv = new byte[codec.getCipherSuite().getAlgorithmBlockSize()]; 
codec.generateSecureRandom(iv);
{code}





--
This message was sent by Atlassian JIRA
(v6.2#6252)