mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Merge remote-tracking branch 'origin/pr/2092' into development
* origin/pr/2092: Add more missing parentheses around macro parameters Add further missing brackets around macro parameters Adapt ChangeLog Improve macro hygiene
This commit is contained in:
@ -689,11 +689,14 @@ static int get_auth_mode( const char *s )
|
||||
* Used by sni_parse and psk_parse to handle coma-separated lists
|
||||
*/
|
||||
#define GET_ITEM( dst ) \
|
||||
dst = p; \
|
||||
while( *p != ',' ) \
|
||||
if( ++p > end ) \
|
||||
goto error; \
|
||||
*p++ = '\0';
|
||||
do \
|
||||
{ \
|
||||
(dst) = p; \
|
||||
while( *p != ',' ) \
|
||||
if( ++p > end ) \
|
||||
goto error; \
|
||||
*p++ = '\0'; \
|
||||
} while( 0 )
|
||||
|
||||
#if defined(SNI_OPTION)
|
||||
typedef struct _sni_entry sni_entry;
|
||||
@ -850,15 +853,18 @@ int sni_callback( void *p_info, mbedtls_ssl_context *ssl,
|
||||
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
|
||||
|
||||
#define HEX2NUM( c ) \
|
||||
if( c >= '0' && c <= '9' ) \
|
||||
c -= '0'; \
|
||||
else if( c >= 'a' && c <= 'f' ) \
|
||||
c -= 'a' - 10; \
|
||||
else if( c >= 'A' && c <= 'F' ) \
|
||||
c -= 'A' - 10; \
|
||||
else \
|
||||
return( -1 );
|
||||
#define HEX2NUM( c ) \
|
||||
do \
|
||||
{ \
|
||||
if( (c) >= '0' && (c) <= '9' ) \
|
||||
(c) -= '0'; \
|
||||
else if( (c) >= 'a' && (c) <= 'f' ) \
|
||||
(c) -= 'a' - 10; \
|
||||
else if( (c) >= 'A' && (c) <= 'F' ) \
|
||||
(c) -= 'A' - 10; \
|
||||
else \
|
||||
return( -1 ); \
|
||||
} while( 0 )
|
||||
|
||||
/*
|
||||
* Convert a hex string to bytes.
|
||||
|
Reference in New Issue
Block a user