Style: Add numerous comments indicating condition guarded by #endif
This commit is contained in:
parent
cf469458ca
commit
bc2498a9ff
@ -1031,14 +1031,14 @@ struct mbedtls_ssl_context
|
|||||||
int renego_records_seen; /*!< Records since renego request, or with DTLS,
|
int renego_records_seen; /*!< Records since renego request, or with DTLS,
|
||||||
number of retransmissions of request if
|
number of retransmissions of request if
|
||||||
renego_max_records is < 0 */
|
renego_max_records is < 0 */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_RENEGOTIATION */
|
||||||
|
|
||||||
int major_ver; /*!< equal to MBEDTLS_SSL_MAJOR_VERSION_3 */
|
int major_ver; /*!< equal to MBEDTLS_SSL_MAJOR_VERSION_3 */
|
||||||
int minor_ver; /*!< either 0 (SSL3) or 1 (TLS1.0) */
|
int minor_ver; /*!< either 0 (SSL3) or 1 (TLS1.0) */
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
|
#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
|
||||||
unsigned badmac_seen; /*!< records with a bad MAC received */
|
unsigned badmac_seen; /*!< records with a bad MAC received */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */
|
||||||
|
|
||||||
mbedtls_ssl_send_t *f_send; /*!< Callback for network send */
|
mbedtls_ssl_send_t *f_send; /*!< Callback for network send */
|
||||||
mbedtls_ssl_recv_t *f_recv; /*!< Callback for network receive */
|
mbedtls_ssl_recv_t *f_recv; /*!< Callback for network receive */
|
||||||
@ -1094,11 +1094,11 @@ struct mbedtls_ssl_context
|
|||||||
uint16_t in_epoch; /*!< DTLS epoch for incoming records */
|
uint16_t in_epoch; /*!< DTLS epoch for incoming records */
|
||||||
size_t next_record_offset; /*!< offset of the next record in datagram
|
size_t next_record_offset; /*!< offset of the next record in datagram
|
||||||
(equal to in_left if none) */
|
(equal to in_left if none) */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
|
#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
|
||||||
uint64_t in_window_top; /*!< last validated record seq_num */
|
uint64_t in_window_top; /*!< last validated record seq_num */
|
||||||
uint64_t in_window; /*!< bitmask for replay detection */
|
uint64_t in_window; /*!< bitmask for replay detection */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */
|
||||||
|
|
||||||
size_t in_hslen; /*!< current handshake message length,
|
size_t in_hslen; /*!< current handshake message length,
|
||||||
including the handshake header */
|
including the handshake header */
|
||||||
@ -1130,14 +1130,14 @@ struct mbedtls_ssl_context
|
|||||||
|
|
||||||
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
#if defined(MBEDTLS_SSL_PROTO_DTLS)
|
||||||
uint16_t mtu; /*!< path mtu, used to fragment outgoing messages */
|
uint16_t mtu; /*!< path mtu, used to fragment outgoing messages */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
#if defined(MBEDTLS_ZLIB_SUPPORT)
|
#if defined(MBEDTLS_ZLIB_SUPPORT)
|
||||||
unsigned char *compress_buf; /*!< zlib data buffer */
|
unsigned char *compress_buf; /*!< zlib data buffer */
|
||||||
#endif
|
#endif /* MBEDTLS_ZLIB_SUPPORT */
|
||||||
#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING)
|
#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING)
|
||||||
signed char split_done; /*!< current record already splitted? */
|
signed char split_done; /*!< current record already splitted? */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PKI layer
|
* PKI layer
|
||||||
@ -1150,11 +1150,11 @@ struct mbedtls_ssl_context
|
|||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||||
char *hostname; /*!< expected peer CN for verification
|
char *hostname; /*!< expected peer CN for verification
|
||||||
(and SNI if available) */
|
(and SNI if available) */
|
||||||
#endif
|
#endif /* MBEDTLS_X509_CRT_PARSE_C */
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_ALPN)
|
#if defined(MBEDTLS_SSL_ALPN)
|
||||||
const char *alpn_chosen; /*!< negotiated protocol */
|
const char *alpn_chosen; /*!< negotiated protocol */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_ALPN */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Information for DTLS hello verify
|
* Information for DTLS hello verify
|
||||||
@ -1162,7 +1162,7 @@ struct mbedtls_ssl_context
|
|||||||
#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C)
|
#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C)
|
||||||
unsigned char *cli_id; /*!< transport-level ID of the client */
|
unsigned char *cli_id; /*!< transport-level ID of the client */
|
||||||
size_t cli_id_len; /*!< length of cli_id */
|
size_t cli_id_len; /*!< length of cli_id */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY && MBEDTLS_SSL_SRV_C */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Secure renegotiation
|
* Secure renegotiation
|
||||||
@ -1174,7 +1174,7 @@ struct mbedtls_ssl_context
|
|||||||
size_t verify_data_len; /*!< length of verify data stored */
|
size_t verify_data_len; /*!< length of verify data stored */
|
||||||
char own_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */
|
char own_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */
|
||||||
char peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */
|
char peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_RENEGOTIATION */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
|
#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
|
||||||
|
@ -1101,7 +1101,7 @@ static int ssl_write_client_hello( mbedtls_ssl_context *ssl )
|
|||||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_flight_transmit", ret );
|
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_flight_transmit", ret );
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write client hello" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write client hello" ) );
|
||||||
|
|
||||||
@ -3414,7 +3414,7 @@ int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl )
|
|||||||
if( ( ret = mbedtls_ssl_flight_transmit( ssl ) ) != 0 )
|
if( ( ret = mbedtls_ssl_flight_transmit( ssl ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
/* Change state now, so that it is right in mbedtls_ssl_read_record(), used
|
/* Change state now, so that it is right in mbedtls_ssl_read_record(), used
|
||||||
* by DTLS for dropping out-of-sequence ChangeCipherSpec records */
|
* by DTLS for dropping out-of-sequence ChangeCipherSpec records */
|
||||||
|
@ -2397,7 +2397,7 @@ static int ssl_write_hello_verify_request( mbedtls_ssl_context *ssl )
|
|||||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_flight_transmit", ret );
|
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_flight_transmit", ret );
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write hello verify request" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write hello verify request" ) );
|
||||||
|
|
||||||
@ -3385,7 +3385,7 @@ static int ssl_write_server_hello_done( mbedtls_ssl_context *ssl )
|
|||||||
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_flight_transmit", ret );
|
MBEDTLS_SSL_DEBUG_RET( 1, "mbedtls_ssl_flight_transmit", ret );
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write server hello done" ) );
|
MBEDTLS_SSL_DEBUG_MSG( 2, ( "<= write server hello done" ) );
|
||||||
|
|
||||||
@ -4264,7 +4264,7 @@ int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl )
|
|||||||
if( ( ret = mbedtls_ssl_flight_transmit( ssl ) ) != 0 )
|
if( ( ret = mbedtls_ssl_flight_transmit( ssl ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||||
|
|
||||||
switch( ssl->state )
|
switch( ssl->state )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user