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/11 02:14:09 UTC

[GitHub] [incubator-shardingsphere] haetao opened a new issue #3932: Spring-Boot + sharding-proxy decodes failed after encoding by AES

haetao opened a new issue #3932: Spring-Boot + sharding-proxy   decodes  failed  after  encoding  by  AES
URL: https://github.com/apache/incubator-shardingsphere/issues/3932
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC4-SNAPSHOT
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   sharding-proxy
   ### Expected behavior
   Executing `select * from t_user`, it will return  the result.
   ### Actual behavior
   When i execute `select * from t_user` it  can not return  the result.
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   The proxy yaml config:
   ```
   schemaName: encrypt_db
   
   dataSource:
     url: jdbc:mysql://localhost:3306/demo_ds?serverTimezone=UTC&useSSL=false
     username: root
     password:
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
     maxPoolSize: 50
   
   encryptRule:
     encryptors:
       encryptor_aes:
         type: aes
         props:
           aes.key.value: 123456abc
       encryptor_md5:
         type: md5
     tables:
       t_user:
         columns:
           user_name:
             plainColumn: user_name
             cipherColumn: user_name_cipher
             encryptor: encryptor_aes
             
           pwd:
             plainColumn: pwd_plain
             cipherColumn: pwd_cipher
             encryptor: encryptor_md5
   
   ```
   the exception:
   
    ```
   javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher
           at com.sun.crypto.provider.CipherCore.prepareInputBuffer(CipherCore.java:1005)
           at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:848)
           at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446)
           at javax.crypto.Cipher.doFinal(Cipher.java:2164)
           at org.apache.shardingsphere.encrypt.strategy.impl.AESEncryptor.decrypt(AESEncryptor.java:73)
           at org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.getQueryData(JDBCDatabaseCommunicationEngine.java:216)
           at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.binary.execute.MySQLComStmtExecuteExecutor.getQueryData(MySQLComStmtExecuteExecutor.java:118)
           at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.binary.execute.MySQLComStmtExecuteExecutor.getQueryData(MySQLComStmtExecuteExecutor.java:57)
           at org.apache.shardingsphere.shardingproxy.frontend.mysql.command.MySQLCommandExecuteEngine.writeQueryData(MySQLCommandExecuteEngine.java:83)
           at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:100)
           at org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
   ```

----------------------------------------------------------------
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] dongzl closed issue #3932: Spring-Boot + sharding-proxy decodes failed after encoding by AES

Posted by GitBox <gi...@apache.org>.
dongzl closed issue #3932: Spring-Boot + sharding-proxy   decodes  failed  after  encoding  by  AES
URL: https://github.com/apache/incubator-shardingsphere/issues/3932
 
 
   

----------------------------------------------------------------
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] dongzl commented on issue #3932: Spring-Boot + sharding-proxy decodes failed after encoding by AES

Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #3932: Spring-Boot + sharding-proxy   decodes  failed  after  encoding  by  AES
URL: https://github.com/apache/incubator-shardingsphere/issues/3932#issuecomment-599004589
 
 
   fix by #4637 .

----------------------------------------------------------------
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 issue #3932: Spring-Boot + sharding-proxy decodes failed after encoding by AES

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #3932: Spring-Boot + sharding-proxy   decodes  failed  after  encoding  by  AES
URL: https://github.com/apache/incubator-shardingsphere/issues/3932#issuecomment-593054131
 
 
   Hi, From @sunbufu 's investigation, it is because that we replace `cipherColumn` with `logicColumn` which has the same name with `plainColumn` in `JDBCDatabaseCommunicationEngine.setLogicColumns()`, so two same column names exist in `QueryHeaders`.
   
   The root solution to solve this issue is to consider a better way from the `encrypted metadata`,  for which more effort is required.

----------------------------------------------------------------
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] dongzl edited a comment on issue #3932: Spring-Boot + sharding-proxy decodes failed after encoding by AES

Posted by GitBox <gi...@apache.org>.
dongzl edited a comment on issue #3932: Spring-Boot + sharding-proxy   decodes  failed  after  encoding  by  AES
URL: https://github.com/apache/incubator-shardingsphere/issues/3932#issuecomment-599004589
 
 
   fixes by #4637 .

----------------------------------------------------------------
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