From: Wilfried Göesgens Date: Tue, 5 Jan 2010 21:59:47 +0000 (+0000) Subject: * make it const where possible... X-Git-Tag: v7.86~530 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=4bff53bf1cdb8e74b3e67db0e0ba9d1c1a042d65 * make it const where possible... * cast into openssl, they want unsigned char * (why?) --- diff --git a/citadel/modules/crypto/serv_crypto.c b/citadel/modules/crypto/serv_crypto.c index 21ccd8251..5224aaac8 100644 --- a/citadel/modules/crypto/serv_crypto.c +++ b/citadel/modules/crypto/serv_crypto.c @@ -260,17 +260,23 @@ void init_ssl(void) */ X509_NAME_add_entry_by_txt(name, "O", - MBSTRING_ASC, config.c_humannode, -1, -1, 0); + MBSTRING_ASC, + (unsigned char*) config.c_humannode, + -1, -1, 0); X509_NAME_add_entry_by_txt(name, "OU", - MBSTRING_ASC, "Citadel server", -1, -1, 0); + MBSTRING_ASC, + (unsigned const char*)"Citadel server", + -1, -1, 0); /* X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, config.c_fqdn, -1, -1, 0); */ - X509_NAME_add_entry_by_txt(name, "CN", - MBSTRING_ASC, "*", -1, -1, 0); + X509_NAME_add_entry_by_txt(name, + "CN", + MBSTRING_ASC, + (const unsigned char *)"*", -1, -1, 0); X509_REQ_set_subject_name(req, name); @@ -387,7 +393,7 @@ void init_ssl(void) /* * client_write_ssl() Send binary data to the client encrypted. */ -void client_write_ssl(char *buf, int nbytes) +void client_write_ssl(const char *buf, int nbytes) { int retval; int nremain; diff --git a/citadel/modules/crypto/serv_crypto.h b/citadel/modules/crypto/serv_crypto.h index 501748281..ff20828be 100644 --- a/citadel/modules/crypto/serv_crypto.h +++ b/citadel/modules/crypto/serv_crypto.h @@ -14,7 +14,7 @@ #ifdef HAVE_OPENSSL void destruct_ssl(void); void init_ssl(void); -void client_write_ssl (char *buf, int nbytes); +void client_write_ssl (const char *buf, int nbytes); int client_read_ssl (char *buf, int bytes, int timeout); void cmd_stls(char *params); void cmd_gtls(char *params); diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 137e9c59b..a0ba89b2c 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -441,7 +441,7 @@ void flush_output(void) { /* * client_write() ... Send binary data to the client. */ -int client_write(char *buf, int nbytes) +int client_write(const char *buf, int nbytes) { int bytes_written = 0; int retval; diff --git a/citadel/sysdep_decls.h b/citadel/sysdep_decls.h index 13e9bcfc6..617d90651 100644 --- a/citadel/sysdep_decls.h +++ b/citadel/sysdep_decls.h @@ -59,7 +59,7 @@ int ig_uds_server(char *sockpath, int queue_len, char **errormessage); void buffer_output(void); void unbuffer_output(void); void flush_output(void); -int client_write (char *buf, int nbytes); +int client_write (const char *buf, int nbytes); int client_read_to (char *buf, int bytes, int timeout); int client_read (char *buf, int bytes); int client_getln (char *buf, int maxbytes);