Fixed const correctness issues in programs and tests
This commit is contained in:
parent
eae09db9e5
commit
e0225e4d7f
21 changed files with 108 additions and 89 deletions
|
@ -63,14 +63,14 @@
|
|||
*/
|
||||
struct options
|
||||
{
|
||||
char *server_name; /* hostname of the server (client only) */
|
||||
const char *server_name; /* hostname of the server (client only) */
|
||||
int server_port; /* port on which the ssl service runs */
|
||||
int debug_level; /* level of debugging */
|
||||
char *request_page; /* page on server to request */
|
||||
char *ca_file; /* the file with the CA certificate(s) */
|
||||
char *ca_path; /* the path with the CA certificate(s) reside */
|
||||
char *crt_file; /* the file with the client certificate */
|
||||
char *key_file; /* the file with the client key */
|
||||
const char *request_page; /* page on server to request */
|
||||
const char *ca_file; /* the file with the CA certificate(s) */
|
||||
const char *ca_path; /* the path with the CA certificate(s) reside */
|
||||
const char *crt_file; /* the file with the client certificate */
|
||||
const char *key_file; /* the file with the client key */
|
||||
int force_ciphersuite[2]; /* protocol/ciphersuite to use, or all */
|
||||
int renegotiation; /* enable / disable renegotiation */
|
||||
int allow_legacy; /* allow legacy renegotiation */
|
||||
|
@ -182,7 +182,7 @@ int main( int argc, char *argv[] )
|
|||
{
|
||||
int ret = 0, len, server_fd;
|
||||
unsigned char buf[1024];
|
||||
char *pers = "ssl_client2";
|
||||
const char *pers = "ssl_client2";
|
||||
|
||||
entropy_context entropy;
|
||||
ctr_drbg_context ctr_drbg;
|
||||
|
@ -365,7 +365,8 @@ int main( int argc, char *argv[] )
|
|||
|
||||
entropy_init( &entropy );
|
||||
if( ( ret = ctr_drbg_init( &ctr_drbg, entropy_func, &entropy,
|
||||
(unsigned char *) pers, strlen( pers ) ) ) != 0 )
|
||||
(const unsigned char *) pers,
|
||||
strlen( pers ) ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! ctr_drbg_init returned -0x%x\n", -ret );
|
||||
goto exit;
|
||||
|
@ -387,7 +388,7 @@ int main( int argc, char *argv[] )
|
|||
else
|
||||
#endif
|
||||
#if defined(POLARSSL_CERTS_C)
|
||||
ret = x509parse_crt( &cacert, (unsigned char *) test_ca_crt,
|
||||
ret = x509parse_crt( &cacert, (const unsigned char *) test_ca_crt,
|
||||
strlen( test_ca_crt ) );
|
||||
#else
|
||||
{
|
||||
|
@ -417,7 +418,7 @@ int main( int argc, char *argv[] )
|
|||
else
|
||||
#endif
|
||||
#if defined(POLARSSL_CERTS_C)
|
||||
ret = x509parse_crt( &clicert, (unsigned char *) test_cli_crt,
|
||||
ret = x509parse_crt( &clicert, (const unsigned char *) test_cli_crt,
|
||||
strlen( test_cli_crt ) );
|
||||
#else
|
||||
{
|
||||
|
@ -437,7 +438,7 @@ int main( int argc, char *argv[] )
|
|||
else
|
||||
#endif
|
||||
#if defined(POLARSSL_CERTS_C)
|
||||
ret = x509parse_key( &rsa, (unsigned char *) test_cli_key,
|
||||
ret = x509parse_key( &rsa, (const unsigned char *) test_cli_key,
|
||||
strlen( test_cli_key ), NULL, 0 );
|
||||
#else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue