Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-13009

Intermittently jasypt property-placeholder is not able to decrypt text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • fuse-6.3-R14-GA
    • Camel, Fabric8 v1, Karaf
    • None
    • % %
      • Not able to reproduce in local setup. Attached debug level logs from customer setup. Customer can't provide complete code.

      • Following configuration used to work well with R10 and previous patches. But now customer is migrating to R14 patch and facing this issue.
      • Customer is having configurations similar as following.
        <reference id="fabricService" interface="io.fabric8.api.FabricService" availability="mandatory"/>
          <cm:property-placeholder persistent-id="csp.test.1" depends-on="fabricService"/>
          <cm:property-placeholder persistent-id="csp.test.2" placeholder-prefix="$DB{"/>
          
          <enc:property-placeholder placeholder-prefix="{{" placeholder-suffix="}}" depends-on="fabricService">
            <enc:encryptor class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
                <property name="config">
                    <bean class="org.jasypt.encryption.pbe.config.SimplePBEConfig">
                        <property name="algorithm" value="$(encryption.algorithm)"/>
                        <property name="password" value="$(encryption.password)"/>
                    </bean>
                </property>
            </enc:encryptor>
        </enc:property-placeholder>
        
      • encryption.alogrithm is set to PBEWITHMD5ANDDES. But that is also encrypted as following in PID.
        encryption.algorithm=${crypt:ieJazvB1UD+9t8KhM1BJ17Om5/8FCxm5mgHLkPzFRYI=}
        
      • While removing or adding profiles or even while restarting container following error is observed.
        Caused by: org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException: crypt:ieJazvB1UD+9t8KhM1BJ17Om5/8FCxm5mgHLkPzFRYI= SecretKeyFactory not available
                at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:735)[71:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
                at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:553)[71:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
                at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:705)[71:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
                at org.apache.karaf.jaas.jasypt.handler.EncryptablePropertyPlaceholder.getProperty(EncryptablePropertyPlaceholder.java:38)[4729:org.apache.karaf.jaas.jasypt:2.4.0.redhat-630416]
                at org.apache.aries.blueprint.ext.AbstractPropertyPlaceholder.retrieveValue(AbstractPropertyPlaceholder.java:430)[17:org.apache.aries.blueprint.core:1.8.0]
                at org.apache.aries.blueprint.ext.AbstractPropertyPlaceholder.processString(AbstractPropertyPlaceholder.java:443)[17:org.apache.aries.blueprint.core:1.8.0]
                at org.apache.aries.blueprint.ext.AbstractPropertyPlaceholder$LateBindingValueMetadata.getStringValue(AbstractPropertyPlaceholder.java:477)[17:org.apache.aries.blueprint.core:1.8.0]
                at org.apache.aries.blueprint.di.ValueRecipe.internalCreate(ValueRecipe.java:54)[17:org.apache.aries.blueprint.core:1.8.0]
                ... 31 more
        Caused by: java.security.NoSuchAlgorithmException: crypt:ieJazvB1UD+9t8KhM1BJ17Om5/8FCxm5mgHLkPzFRYI= SecretKeyFactory not available
                at javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:122)[:1.8.0_171]
                at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:160)[:1.8.0_171]
                at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:722)[71:org.apache.servicemix.bundles.jasypt:1.9.3.redhat_3]
                ... 38 more
        
        
      • From error stack-trace it is apparent that encryption.algorithm is not being decrypted to actual algorithm PBEWITHMD5ANDDES.
      • This is intermittent, it fails many times and few times it works well.
      • It appears related to ENTESB-7408 but is specific to blueprint property-placeholder 'cm:property-placeholder' (not jasypt 'enc:'). Customer have set this too with both cm: and enc: placeholders. But issue still appears and always with 'enc:' placeholder while decrypting encryption.algorithm
        <reference id="fabricService" interface="io.fabric8.api.FabricService" availability="mandatory"/>
        <cm:property-placeholder id="properties" persistent-id="encrypted.properties" depends-on="fabricService"/>
        

        1. list_-t_0_-l.txt
          28 kB
          Chandra Shekhar Pandey

              ggrzybek Grzegorz Grzybek
              rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
              Vratislav Hais Vratislav Hais (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: