Hi,
first, happy new year everyone!
The javadoc for
SSLEngine.unwrap(ByteBuffer src,
ByteBuffer[] dsts,
int offset,
int length)
writes "Depending on the state of the SSLEngine, this method may consume network data +*without producing any application data*+ (for example, _it may consume handshake data_.)".
Does this mean that no dsts buffer data is written when in handshaking phase? I have a 0 byte dsts ByteBuffer and I get an SSLEngineResult.Status BUFFER_OVERFLOW after the first call to unwrap(myreceiveddata). The received data seems to be proper handshake data. So is this javadoc entry wrong? It is here:
http://java.sun.com/javase/6/docs/api/javax/net/ssl/SSLEngine.html#unwrap(java.nio.ByteBuffer, java.nio.ByteBuffer[], int, int).
Also, the intro to class SSLEngine has a code snippet for the SSLEngineResult of SSLEngine.unwrap(). For the buffer underflow case there is a check "if (netSize > dst.capacity())". Is this correct? If yes, what's the logic? Link:
http://java.sun.com/javase/6/docs/api/javax/net/ssl/SSLEngine.html
Thanks,
Lars