1

I kind of got stuck with this exception:

java.security.cert.CertificateException: java.lang.RuntimeException: error:04000070:RSA routines:OPENSSL_internal:DATA_LEN_NOT_EQUAL_TO_MOD_LEN
at com.android.org.conscrypt.OpenSSLX509Certificate.verifyOpenSSL(OpenSSLX509Certificate.java:366)
at com.android.org.conscrypt.OpenSSLX509Certificate.verify(OpenSSLX509Certificate.java:394)
at com.ss.app1.view.PCMVoiceView.sendVerification(PCMVoiceView.java:493)
at com.ss.app1.view.PCMVoiceView$1.onOpen(PCMVoiceView.java:109)
at org.java_websocket.client.WebSocketClient.onWebsocketOpen(WebSocketClient.java:379)
at org.java_websocket.WebSocketImpl.open(WebSocketImpl.java:706)
at org.java_websocket.WebSocketImpl.decodeHandshake(WebSocketImpl.java:330)
at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:215)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:287)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.RuntimeException: error:04000070:RSA routines:OPENSSL_internal:DATA_LEN_NOT_EQUAL_TO_MOD_LEN
at com.android.org.conscrypt.NativeCrypto.X509_verify(Native Method)
at com.android.org.conscrypt.OpenSSLX509Certificate.verifyOpenSSL(OpenSSLX509Certificate.java:364)
... 9 more

I am writing some ssl test code.

However, when i verify with publickey obtained from downloaded certificate, OPENSSL_internal:DATA_LEN_NOT_EQUAL_TO_MOD_LEN error occurs.

I think it's a pkcs padding problem ... I'm not sure, I can not find a solution. (All the solutions I found are related to cipher ...)

I need help.

thank you.

X509Certificate cert = customTrustManager.getLastCheckedCertificate(); //this is no problems (get certificates)
PublicKey pubkey = cert.getPublicKey(); //this is no problems

try {
    cert.verify(pubkey); //certificate exception (RSA routines:OPENSSL_internal:DATA_LEN_NOT_EQUAL_TO_MOD_LEN)
    verification_status = true;
}
oh oh
  • 11
  • 3

0 Answers0