When passing the inner content type to msg_callback,
the lowest byte of rec->type needs to be passed instead
of directly passing the rec->type otherwise the value is
incorrect on Big Endian platforms.
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28627)
return 0;
}
- if (rl->msg_callback != NULL)
- rl->msg_callback(0, rl->version, SSL3_RT_INNER_CONTENT_TYPE, &rec->type,
- 1, rl->cbarg);
+ if (rl->msg_callback != NULL) {
+ unsigned char ctype = (unsigned char)rec->type;
+
+ rl->msg_callback(0, rl->version, SSL3_RT_INNER_CONTENT_TYPE, &ctype,
+ 1, rl->cbarg);
+ }
/*
* TLSv1.3 alert and handshake records are required to be non-zero in