org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.

Jenkins JIRA | robmoore | 2 years ago
  1. 0

    An issue similar to this has been logged as JENKINS-18897. I've looked through that ticket but haven't found any way to resolve the issue we are seeing. We are using 2 git repositories. The ssh-agent works fine with one but with another we are seeing the following error: {code} ssh-agent] Using credentials git (Stash System Key) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/JNR ssh-agent [ssh-agent] Unable to read key: exception using cipher - please check password and data. org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data. at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMReader$KeyPairParser.readKeyPair(Unknown Source) at org.bouncycastle.openssl.PEMReader$RSAKeyPairParser.parseObject(Unknown Source) at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source) at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:309) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:290) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:249) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:652) ... 21 more Caused by: java.util.jar.JarException: Class is on the bootclasspath at javax.crypto.JarVerifier.verify(JarVerifier.java:247) at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:160) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:186) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:225) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:116) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:96) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:81) at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:78) ... 15 more [ssh-agent] Started. {code} We use separate keys for each repo.

    Jenkins JIRA | 2 years ago | robmoore
    org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.
  2. 0

    An issue similar to this has been logged as JENKINS-18897. I've looked through that ticket but haven't found any way to resolve the issue we are seeing. We are using 2 git repositories. The ssh-agent works fine with one but with another we are seeing the following error: {code} ssh-agent] Using credentials git (Stash System Key) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/JNR ssh-agent [ssh-agent] Unable to read key: exception using cipher - please check password and data. org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data. at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMReader$KeyPairParser.readKeyPair(Unknown Source) at org.bouncycastle.openssl.PEMReader$RSAKeyPairParser.parseObject(Unknown Source) at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source) at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:309) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:290) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:249) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:652) ... 21 more Caused by: java.util.jar.JarException: Class is on the bootclasspath at javax.crypto.JarVerifier.verify(JarVerifier.java:247) at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:160) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:186) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:225) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:116) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:96) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:81) at com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:78) ... 15 more [ssh-agent] Started. {code} We use separate keys for each repo.

    Jenkins JIRA | 2 years ago | robmoore
    org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.
  3. 0

    SSH Access on Cloudbees

    Stack Overflow | 1 year ago | sofarsogood
    org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Get the following error when i try to run on windows slave, works fine on Master (centos). A similar issue was raised back in July but for a different configuration, JENKINS-18897. {code} [ssh-agent] Using credentials jenkins [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/tomcat-native ssh-agent ERROR: [ssh-agent] Unable to read key: exception using cipher - please check password and data. org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data. at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMReader$KeyPairParser.readKeyPair(Unknown Source) at org.bouncycastle.openssl.PEMReader$RSAKeyPairParser.parseObject(Unknown Source) at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:642) ... 22 more Caused by: java.util.jar.JarException: Class is on the bootclasspath at javax.crypto.JarVerifier.verify(JarVerifier.java:247) at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:223) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:97) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:77) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:68) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:79) ... 16 more [ssh-agent] Started. {code} Anyway help on this would be appreciated, my Java programming is a bit outdated, more of a .net developer nowadays.

    Jenkins JIRA | 3 years ago | Shamul Rohman
    org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.
  6. 0

    Get the following error when i try to run on windows slave, works fine on Master (centos). A similar issue was raised back in July but for a different configuration, JENKINS-18897. {code} [ssh-agent] Using credentials jenkins [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/tomcat-native ssh-agent ERROR: [ssh-agent] Unable to read key: exception using cipher - please check password and data. org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data. at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source) at org.bouncycastle.openssl.PEMReader$KeyPairParser.readKeyPair(Unknown Source) at org.bouncycastle.openssl.PEMReader$RSAKeyPairParser.parseObject(Unknown Source) at org.bouncycastle.openssl.PEMReader.readObject(Unknown Source) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at hudson.remoting.Engine$1$1.run(Engine.java:63) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.Cipher.getInstance(Cipher.java:642) ... 22 more Caused by: java.util.jar.JarException: Class is on the bootclasspath at javax.crypto.JarVerifier.verify(JarVerifier.java:247) at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161) at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187) at javax.crypto.JceSecurity.getInstance(JceSecurity.java:98) at javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:223) at org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:97) at org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:77) at org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:68) at com.cloudbees.jenkins.plugins.sshagent.mina.MinaRemoteAgent.addIdentity(MinaRemoteAgent.java:79) ... 16 more [ssh-agent] Started. {code} Anyway help on this would be appreciated, my Java programming is a bit outdated, more of a .net developer nowadays.

    Jenkins JIRA | 3 years ago | Shamul Rohman
    org.bouncycastle.openssl.EncryptionException: exception using cipher - please check password and data.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.jar.JarException

      Class is on the bootclasspath

      at javax.crypto.JarVerifier.verify()
    2. Android Platform
      KeyAgreement.getInstance
      1. javax.crypto.JarVerifier.verify(JarVerifier.java:247)
      2. javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:160)
      3. javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:186)
      4. javax.crypto.JceSecurity.getInstance(JceSecurity.java:98)
      5. javax.crypto.KeyAgreement.getInstance(KeyAgreement.java:225)
      5 frames
    3. Apache Mina SSHD :: Core
      SecurityUtils.isBouncyCastleRegistered
      1. org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration.run(SecurityUtils.java:116)
      2. org.apache.sshd.common.util.SecurityUtils.register(SecurityUtils.java:96)
      3. org.apache.sshd.common.util.SecurityUtils.isBouncyCastleRegistered(SecurityUtils.java:81)
      3 frames
    4. com.cloudbees.jenkins
      JNRRemoteAgent.addIdentity
      1. com.cloudbees.jenkins.plugins.sshagent.jna.JNRRemoteAgent.addIdentity(JNRRemoteAgent.java:78)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:483)
      4 frames
    6. Hudson :: Remoting Layer
      InterceptingExecutorService$1.call
      1. hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:309)
      2. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:290)
      3. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:249)
      4. hudson.remoting.UserRequest.perform(UserRequest.java:118)
      5. hudson.remoting.UserRequest.perform(UserRequest.java:48)
      6. hudson.remoting.Request$2.run(Request.java:328)
      7. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      7 frames
    7. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      4. java.lang.Thread.run(Thread.java:745)
      4 frames