Fixed const correctness issues in programs and tests

This commit is contained in:
Paul Bakker 2013-06-06 12:52:24 +02:00
parent eae09db9e5
commit e0225e4d7f
21 changed files with 108 additions and 89 deletions

View file

@ -74,10 +74,10 @@ struct options
{
int server_port; /* port on which the ssl service runs */
int debug_level; /* level of debugging */
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 *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 */
@ -236,7 +236,7 @@ int main( int argc, char *argv[] )
int listen_fd;
int client_fd = -1;
unsigned char buf[1024];
char *pers = "ssl_server2";
const char *pers = "ssl_server2";
entropy_context entropy;
ctr_drbg_context ctr_drbg;
@ -380,7 +380,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;
@ -402,7 +403,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
{
@ -430,7 +431,7 @@ int main( int argc, char *argv[] )
else
#endif
#if defined(POLARSSL_CERTS_C)
ret = x509parse_crt( &srvcert, (unsigned char *) test_srv_crt,
ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
strlen( test_srv_crt ) );
#else
{
@ -450,7 +451,7 @@ int main( int argc, char *argv[] )
else
#endif
#if defined(POLARSSL_CERTS_C)
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 );
#else
{