Fixed const correctness issues in programs and tests

(cherry picked from commit e0225e4d7f18f4565224f4997af537533d06a80d)

Conflicts:
	programs/ssl/ssl_client2.c
	programs/ssl/ssl_server2.c
	programs/test/ssl_test.c
	programs/x509/cert_app.c
This commit is contained in:
Paul Bakker 2013-06-24 13:01:08 +02:00
parent 3c2122ff9d
commit ef3f8c747e
21 changed files with 112 additions and 93 deletions

View file

@ -74,7 +74,7 @@ struct options
{
int opmode; /* operation mode (client or server) */
int iomode; /* I/O mode (blocking or non-blocking) */
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 command; /* what to do: read or write operation */
int buffer_size; /* size of the send/receive buffer */
@ -153,7 +153,7 @@ static int ssl_test( struct options *opt )
unsigned char *read_buf = NULL;
unsigned char *write_buf = NULL;
char *pers = "ssl_test";
const char *pers = "ssl_test";
struct hr_time t;
entropy_context entropy;
@ -166,7 +166,8 @@ static int ssl_test( struct options *opt )
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( " ! ctr_drbg_init returned %d\n", ret );
goto exit;
@ -204,7 +205,7 @@ static int ssl_test( struct options *opt )
printf("POLARSSL_CERTS_C not defined.\n");
goto exit;
#else
ret = x509parse_crt( &srvcert, (unsigned char *) test_srv_crt,
ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
strlen( test_srv_crt ) );
if( ret != 0 )
{
@ -212,7 +213,7 @@ static int ssl_test( struct options *opt )
goto exit;
}
ret = x509parse_crt( &srvcert, (unsigned char *) test_ca_crt,
ret = x509parse_crt( &srvcert, (const unsigned char *) test_ca_crt,
strlen( test_ca_crt ) );
if( ret != 0 )
{
@ -220,7 +221,7 @@ static int ssl_test( struct options *opt )
goto exit;
}
ret = x509parse_key( &rsa, (unsigned char *) test_srv_key,
ret = x509parse_key( &rsa, (const unsigned char *) test_srv_key,
strlen( test_srv_key ), NULL, 0 );
if( ret != 0 )
{