mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Avoid issues with endianness when type is used in SSL_trace()
The TLS record type is a single byte value so we can use uint8_t for it. This allows passing its address directly to SSL_trace() instead of converting it to a single byte type first. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21823)
This commit is contained in:
parent
675481ee7a
commit
1cc8c53b0f
@ -507,7 +507,7 @@ struct ossl_record_method_st {
|
||||
* multiple records in one go and buffer them.
|
||||
*/
|
||||
int (*read_record)(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
|
||||
int *type, unsigned char **data, size_t *datalen,
|
||||
uint8_t *type, unsigned char **data, size_t *datalen,
|
||||
uint16_t *epoch, unsigned char *seq_num);
|
||||
/*
|
||||
* Release a buffer associated with a record previously read with
|
||||
|
@ -232,7 +232,7 @@ struct ossl_record_method_st {
|
||||
* multiple records in one go and buffer them.
|
||||
*/
|
||||
int (*read_record)(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
|
||||
int *type, const unsigned char **data, size_t *datalen,
|
||||
uint8_t *type, const unsigned char **data, size_t *datalen,
|
||||
uint16_t *epoch, unsigned char *seq_num);
|
||||
/*
|
||||
* Release length bytes from a buffer associated with a record previously
|
||||
|
@ -356,7 +356,7 @@ static int quic_retry_write_records(OSSL_RECORD_LAYER *rl)
|
||||
}
|
||||
|
||||
static int quic_read_record(OSSL_RECORD_LAYER *rl, void **rechandle,
|
||||
int *rversion, int *type, const unsigned char **data,
|
||||
int *rversion, uint8_t *type, const unsigned char **data,
|
||||
size_t *datalen, uint16_t *epoch,
|
||||
unsigned char *seq_num)
|
||||
{
|
||||
|
@ -459,7 +459,7 @@ int tls_retry_write_records(OSSL_RECORD_LAYER *rl);
|
||||
int tls_get_alert_code(OSSL_RECORD_LAYER *rl);
|
||||
int tls_set1_bio(OSSL_RECORD_LAYER *rl, BIO *bio);
|
||||
int tls_read_record(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
|
||||
int *type, const unsigned char **data, size_t *datalen,
|
||||
uint8_t *type, const unsigned char **data, size_t *datalen,
|
||||
uint16_t *epoch, unsigned char *seq_num);
|
||||
int tls_release_record(OSSL_RECORD_LAYER *rl, void *rechandle, size_t length);
|
||||
int tls_default_set_protocol_version(OSSL_RECORD_LAYER *rl, int version);
|
||||
|
@ -1088,7 +1088,7 @@ int tls13_common_post_process_record(OSSL_RECORD_LAYER *rl, TLS_RL_RECORD *rec)
|
||||
}
|
||||
|
||||
int tls_read_record(OSSL_RECORD_LAYER *rl, void **rechandle, int *rversion,
|
||||
int *type, const unsigned char **data, size_t *datalen,
|
||||
uint8_t *type, const unsigned char **data, size_t *datalen,
|
||||
uint16_t *epoch, unsigned char *seq_num)
|
||||
{
|
||||
TLS_RL_RECORD *rec;
|
||||
|
@ -22,7 +22,7 @@
|
||||
typedef struct tls_record_st {
|
||||
void *rechandle;
|
||||
int version;
|
||||
int type;
|
||||
uint8_t type;
|
||||
/* The data buffer containing bytes from the record */
|
||||
const unsigned char *data;
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user