accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubbsii <...@git.apache.org>
Subject [GitHub] accumulo pull request #163: ACCUMULO-2278 Return value from in.read() should...
Date Wed, 12 Oct 2016 04:38:51 GMT
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/163#discussion_r82935160
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
---
    @@ -81,7 +81,10 @@ private void doKeyEncryptionOperation(int encryptionMode, CryptoModuleParameters
           Cipher cipher = DefaultCryptoModuleUtils.getCipher(params.getAllOptions().get(Property.CRYPTO_DEFAULT_KEY_STRATEGY_CIPHER_SUITE.getKey()));
     
           try {
    -        cipher.init(encryptionMode, new SecretKeySpec(keyEncryptionKey, params.getAlgorithmName()));
    +    	if (keyEncryptionKey.length > 0)
    --- End diff --
    
    This makes me wonder what the API contract is on `read()`. Will the return value from
this always be equal to the length of the byte array? If it's not, should we explicitly throw
an `InvalidKeyException`? Should we use some `readFully()` method to populate the read buffer
instead of `read()`?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message