Fixed const correctness issues in programs and tests
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index c1b3810..a37a077 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -74,10 +74,10 @@
{
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 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 @@
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 @@
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 @@
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 @@
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
{