Skip to content

Commit

Permalink
Don't return value from void function
Browse files Browse the repository at this point in the history
Signed-off-by: Hanno Becker <[email protected]>
  • Loading branch information
Hanno Becker committed Jun 18, 2021
1 parent d0c4db6 commit 2fdede8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions programs/ssl/ssl_test_common_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ void eap_tls_key_derivation( void *p_expkey,

/* We're only interested in the TLS 1.2 master secret */
if( secret_type != MBEDTLS_SSL_KEY_EXPORT_TLS12_MASTER_SECRET )
return( 0 );
return;
if( secret_len != sizeof( keys->master_secret ) )
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
return;

memcpy( keys->master_secret, secret, sizeof( keys->master_secret ) );
memcpy( keys->randbytes, client_random, 32 );
memcpy( keys->randbytes + 32, server_random, 32 );
keys->tls_prf_type = tls_prf_type;

return( 0 );
}

void nss_keylog_export( void *p_expkey,
Expand All @@ -65,7 +63,7 @@ void nss_keylog_export( void *p_expkey,

/* We're only interested in the TLS 1.2 master secret */
if( secret_type != MBEDTLS_SSL_KEY_EXPORT_TLS12_MASTER_SECRET )
return( 0 );
return;

((void) p_expkey);
((void) server_random);
Expand Down Expand Up @@ -119,7 +117,6 @@ void nss_keylog_export( void *p_expkey,
exit:
mbedtls_platform_zeroize( nss_keylog_line,
sizeof( nss_keylog_line ) );
return( ret );
}

#if defined( MBEDTLS_SSL_DTLS_SRTP )
Expand All @@ -135,16 +132,14 @@ void dtls_srtp_key_derivation( void *p_expkey,

/* We're only interested in the TLS 1.2 master secret */
if( secret_type != MBEDTLS_SSL_KEY_EXPORT_TLS12_MASTER_SECRET )
return( 0 );
return;
if( secret_len != sizeof( keys->master_secret ) )
return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA );
return;

memcpy( keys->master_secret, secret, sizeof( keys->master_secret ) );
memcpy( keys->randbytes, client_random, 32 );
memcpy( keys->randbytes + 32, server_random, 32 );
keys->tls_prf_type = tls_prf_type;

return( 0 );
}
#endif /* MBEDTLS_SSL_DTLS_SRTP */

Expand Down

0 comments on commit 2fdede8

Please sign in to comment.