- it's up the peers to re transmit the DTLS messages. Haven't noticed
any issue on openssl 1.0.1c about it.
- the handshaking is finished when 'SSL_is_init_finished()' returns
true but at this state you're still not ready to receive data as you
don't have SRTP keys yet
- SRTP keys will be sent DTLS-encrypted. Use
SSL_export_keying_material("EXTRACTOR-dtls_srtp") for the keys and
"SSL_get_selected_srtp_profile()" for the SRTP profile
- when both sides are passive or active, you can detect it easily and
recover:
if(dtlsData[0] == 0x16){ means it's handshake message
// dtlsData[13] == 0x01 -> Client Hello
// dtlsData[13] == 0x02 -> Server Hello
// more info in rfc6347