You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/22 15:27:04 UTC

[GitHub] [incubator-shardingsphere] SteNicholas opened a new pull request #4068: Encryptor encrypt plaintext with null object

SteNicholas opened a new pull request #4068: Encryptor encrypt plaintext with null object
URL: https://github.com/apache/incubator-shardingsphere/pull/4068
 
 
   Fixes #3924.
   
   `Encryptor` encrypts plaintext with null object could cause exception, because `String.valueOf` method with null object return "null" string, which should be regarded as null object.  Therefore, this should add null object judgement. Similar to [3925](https://github.com/apache/incubator-shardingsphere/pull/3925/files).
   
   Changes proposed in this pull request:
   - Method `encrypt` of   dd null object judgement.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero merged pull request #4068: Encryptor encrypt plaintext with null object

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #4068: Encryptor encrypt plaintext with null object
URL: https://github.com/apache/incubator-shardingsphere/pull/4068
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] tristaZero commented on a change in pull request #4068: Encryptor encrypt plaintext with null object

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #4068: Encryptor encrypt plaintext with null object
URL: https://github.com/apache/incubator-shardingsphere/pull/4068#discussion_r369905045
 
 

 ##########
 File path: encrypt-core/encrypt-core-common/src/main/java/org/apache/shardingsphere/encrypt/strategy/impl/AESEncryptor.java
 ##########
 @@ -70,7 +73,7 @@ public Object decrypt(final String ciphertext) {
         if (null == ciphertext) {
             return null;
         }
-        byte[] result = getCipher(Cipher.DECRYPT_MODE).doFinal(Base64.decodeBase64(String.valueOf(ciphertext)));
+        byte[] result = getCipher(Cipher.DECRYPT_MODE).doFinal(Base64.decodeBase64(ciphertext));
 
 Review comment:
   Why do you want to delete `String.valueOf()`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] coveralls commented on issue #4068: Encryptor encrypt plaintext with null object

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #4068: Encryptor encrypt plaintext with null object
URL: https://github.com/apache/incubator-shardingsphere/pull/4068#issuecomment-577265291
 
 
   ## Pull Request Test Coverage Report for [Build 1477](https://coveralls.io/builds/28262143)
   
   * **3** of **5**   **(60.0%)**  changed or added relevant lines in **2** files are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage decreased (**-0.004%**) to **66.648%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [encrypt-core/encrypt-core-common/src/main/java/org/apache/shardingsphere/encrypt/strategy/impl/AESEncryptor.java](https://coveralls.io/builds/28262143/source?filename=encrypt-core%2Fencrypt-core-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fencrypt%2Fstrategy%2Fimpl%2FAESEncryptor.java#L64) | 2 | 3 | 66.67%
   | [encrypt-core/encrypt-core-common/src/main/java/org/apache/shardingsphere/encrypt/strategy/impl/MD5Encryptor.java](https://coveralls.io/builds/28262143/source?filename=encrypt-core%2Fencrypt-core-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fencrypt%2Fstrategy%2Fimpl%2FMD5Encryptor.java#L50) | 1 | 2 | 50.0%
   <!-- | **Total:** | **3** | **5** | **60.0%** | -->
   
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28262143/badge)](https://coveralls.io/builds/28262143) |
   | :-- | --: |
   | Change from base [Build 730](https://coveralls.io/builds/28254876): |  -0.004% |
   | Covered Lines: | 10899 |
   | Relevant Lines: | 16353 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services