uint8_t const *buf = inbuf;
tls_session_t *state = (tls_session_t *)arg;
+ /*
+ * OpenSSL 1.0.2 calls this function with 'pseudo'
+ * content types. Which breaks our tracking of
+ * the SSL Session state.
+ */
+ if ((msg_version == 0) && (content_type > UINT8_MAX)) {
+ DEBUG4("Ignoring cbtls_msg call with pseudo content type %i, version %i",
+ content_type, msg_version);
+ return;
+ }
+
/*
* Work around bug #298, where we may be called with a NULL
* argument. We should really log a serious error
*/
if (!state) return;
+ /*
+ * 0 - received (from peer)
+ * 1 - sending (to peer)
+ */
state->info.origin = write_p;
state->info.content_type = content_type;
state->info.record_len = len;