Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-15984

(7.2.z) failed decrypting message in encrypted cluster after node shut-down: javax.crypto.BadPaddingException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.2.0.GA.CR2
    • Clustering
    • None

      The error causes errors on the client site at a low fail rate: almost 100% of samples are OK and is triggered by fail over (introduced by means of server shut down);
      Nevertheless, this issue occurs in clean shut down scenario (should be as smooth as possible) and floods the logs with errors producing some client side errors.
      It happens in a scenario with a 4 nodes cluster where the cluster traffic is encrypted:

      <protocol type="ASYM_ENCRYPT" xmlns="">
      <property name="encrypt_entire_message">true</property>
      <property name="sym_keylength">128</property>
      <property name="sym_algorithm">AES/ECB/PKCS5Padding</property>
      <property name="asym_keylength">512</property>
      <property name="asym_algorithm">RSA</property>
      </protocol>
      

      The error starts immediately after the one node of the cluster is shut down and re-started affecting the other 3 nodes in the cluster; here is the complete sequence of events:

      • 19:08:43 WildFly on node perf19 is STARTED
      • 19:08:59 WildFly on node perf21 is STARTED
      • 19:09:12 WildFly on node perf18 is STARTED
      • 19:09:25 WildFly on node perf20 is STARTED
      • 19:12:58 WildFly on node perf18 is STOPPED
      • 19:13:00 ERROR perf19: failed decrypting message from perf20 ... javax.crypto.BadPaddingException
      • 19:13:00 ERROR perf20: failed decrypting message from perf19 ... javax.crypto.BadPaddingException
      • 19:13:00 ERROR perf21: failed decrypting message from perf19 ... javax.crypto.BadPaddingException
      • 19:13:15 ERROR perf17: First error on the client side
      • 19:14:00 WildFly on node perf18 is STARTED
      • 19:15:15 WildFly on node perf19 is STOPPED
      • 19:16:18 WildFly on node perf19 is STARTED
      • 19:17:31 WildFly on node perf20 is STOPPED
      • 19:18:34 WildFly on node perf20 is STARTED
      • 19:19:48 WildFly on node perf21 is STOPPED
      • 19:20:50 WildFly on node perf21 is STARTED

      Here is the logs snippet (complete logs here):

      [JBossINF] �[0m�[31m19:13:00,416 ERROR [org.jgroups.protocols.ASYM_ENCRYPT] (thread-27,ejb,perf19) perf19: failed decrypting message from perf20 (offset=0, length=112, buf.length=112): javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption., headers are RequestCorrelator: corr_id=0, type=REQ, req_id=18358, rsp_expected=true, FORK: ejb:web, UNICAST3: DATA, seqno=17932, ASYM_ENCRYPT: ENCRYPT [version=B6003111B71776770C2A9F8631718B7B]
      

            rhn-support-tmiyargi Teresa Miyar Gil (Inactive)
            tborgato@redhat.com Tommaso Borgato
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: