Algorithm missing yet not all client bytes received

I am getting some really funky behavior here....

client sends 100 bytes, server receives 100 bytes

server sends 1217 bytes, client receives 1217

client send 139, server receives 100 (doing asynch I/O)

server receives 39

client sends 6

client sends 53 (status of client SSLEngine goes from WRAP to UNWRAP here)

server receives 6 bytes

Now before the server receives the 53 bytes, I get this exception(shouldn't it have waited until it got the 53 bytes.

Caused by: javax.net.ssl.SSLException: Algorithm missing:

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.changeReadCiphers(SSLEngineImpl.java:526)

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:977)

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:782)

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:674)

at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)

at biz.xsoftware.impl.niosecure.SecureDataHandler.incomingDataImpl(SecureDataHandler.java:66)

at biz.xsoftware.impl.niosecure.SecureDataHandler.incomingData(SecureDataHandler.java:47)

... 5 more

Caused by: java.security.NoSuchAlgorithmException: Could not create cipher AES/128

at com.sun.net.ssl.internal.ssl.CipherBox.newCipherBox(CipherBox.java:124)

at com.sun.net.ssl.internal.ssl.CipherSuite$BulkCipher.newCipher(CipherSuite.java:443)

at com.sun.net.ssl.internal.ssl.Handshaker.newReadCipher(Handshaker.java:335)

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.changeReadCiphers(SSLEngineImpl.java:522)

... 11 more

Caused by: java.lang.IllegalArgumentException: Missing argument

at javax.crypto.spec.SecretKeySpec.<init>(DashoA12275)

at com.sun.net.ssl.internal.ssl.CipherBox.initCipher(CipherBox.java:144)

at com.sun.net.ssl.internal.ssl.CipherBox.newCipherBox(CipherBox.java:119)

... 14 more

thanks for any help on this,

dean

[2019 byte] By [deanhiller2000a] at [2007-10-1 16:36:24]
# 1

okay, i think I found my problem....I forgot the SSLEngine is stateless, and I am pretty sure I was not saving the data when that status was was NEED_UNWRAP.

I know save the data if status is still unwrap and feed it to the engine again. If the sstatus is need_task, do I need to save the data?

deanhiller2000a at 2007-7-11 0:57:12 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2
You always need to keep providing the same netRecvBuffer and netSendBuffer.
ejpa at 2007-7-11 0:57:12 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...