RetroArch
ssl_parse_renegotiation_info.h
Go to the documentation of this file.
1 #ifndef _SSL_PARSE_RENEGOTIATION_INFO_H
2 #define _SSL_PARSE_RENEGOTIATION_INFO_H
3 
5  const unsigned char *buf,
6  size_t len )
7 {
8 #if defined(MBEDTLS_SSL_RENEGOTIATION)
10  {
11  /* Check verify-data in constant-time. The length OTOH is no secret */
12  if( len != 1 + ssl->verify_data_len ||
13  buf[0] != ssl->verify_data_len ||
15  ssl->verify_data_len ) != 0 )
16  {
17  MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-matching renegotiation info" ) );
21  }
22  }
23  else
24 #endif /* MBEDTLS_SSL_RENEGOTIATION */
25  {
26  if( len != 1 || buf[0] != 0x0 )
27  {
28  MBEDTLS_SSL_DEBUG_MSG( 1, ( "non-zero length renegotiation info" ) );
32  }
33 
35  }
36 
37  return( 0 );
38 }
39 
40 #endif
int mbedtls_ssl_send_alert_message(mbedtls_ssl_context *ssl, unsigned char level, unsigned char message)
Send an alert message.
Definition: ssl_tls.c:4113
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
GLenum GLsizei len
Definition: glext.h:7389
#define MBEDTLS_SSL_ALERT_LEVEL_FATAL
Definition: ssl.h:274
int secure_renegotiation
Definition: ssl.h:902
#define MBEDTLS_SSL_DEBUG_MSG(level, args)
Definition: debug.h:42
#define MBEDTLS_SSL_SECURE_RENEGOTIATION
Definition: ssl.h:157
char peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]
Definition: ssl.h:907
Definition: ssl.h:763
size_t verify_data_len
Definition: ssl.h:905
#define MBEDTLS_SSL_INITIAL_HANDSHAKE
Definition: ssl_internal.h:91
#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO
Definition: ssl.h:78
#define MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE
Definition: ssl.h:282
static int mbedtls_ssl_safer_memcmp(const void *a, const void *b, size_t n)
Definition: ssl_internal.h:600
int renego_status
Definition: ssl.h:772
static int ssl_parse_renegotiation_info(mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len)
Definition: ssl_parse_renegotiation_info.h:4