* make it const where possible...
authorWilfried Göesgens <willi@citadel.org>
Tue, 5 Jan 2010 21:59:47 +0000 (21:59 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 5 Jan 2010 21:59:47 +0000 (21:59 +0000)
* cast into openssl, they want unsigned char * (why?)

citadel/modules/crypto/serv_crypto.c
citadel/modules/crypto/serv_crypto.h
citadel/sysdep.c
citadel/sysdep_decls.h

index 21ccd82517b20e0f55fb3a489a3be215b1b89bdd..5224aaac86e85ce93e7fbc8b81e908ea19487a98 100644 (file)
@@ -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;
index 501748281cd749f5f89a7c7d76d4a490d0b20364..ff20828be0654f24ec05b5506b45601363b022d1 100644 (file)
@@ -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);
index 137e9c59b06075ca824ab855cc2e389649b4e0fc..a0ba89b2c71e3144ee2c5e59279f224bc48e7011 100644 (file)
@@ -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;
index 13e9bcfc68e06a2b02c9f18f386c89fc5bf44be0..617d906518b9782c3066cb751d4012e3a0b92a37 100644 (file)
@@ -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);