]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Merge remote-tracking branch 'alex/bug162-SSLCipherList'
authorAlexander Barton <alex@barton.de>
Mon, 16 Sep 2013 15:32:25 +0000 (17:32 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 16 Sep 2013 15:32:25 +0000 (17:32 +0200)
* alex/bug162-SSLCipherList:
  Cipher list selection for GnuTLS
  ConnSSL_Init_SSL(): correctly set CONN_SSL flag
  Cipher list selection for OpenSSL
  ConnSSL_InitLibrary(): Code cleanup

src/ngircd/conn.c
src/ngircd/ngircd.c

index 3b0927872374fccddf3fd9de63ef22b8f4e6524a..324fa4219a9d204723572e1eeb8fbf8ea1badbee 100644 (file)
@@ -2131,6 +2131,7 @@ New_Server( int Server , ng_ipaddr_t *dest)
 
        if (!ng_ipaddr_tostr_r(dest, ip_str)) {
                Log(LOG_WARNING, "New_Server: Could not convert IP to string");
+               Conf_Server[Server].conn_id = NONE;
                return;
        }
 
@@ -2145,11 +2146,14 @@ New_Server( int Server , ng_ipaddr_t *dest)
        if (new_sock < 0) {
                Log(LOG_CRIT, "Can't create socket (af %d): %s!",
                    af_dest, strerror(errno));
+               Conf_Server[Server].conn_id = NONE;
                return;
        }
 
-       if (!Init_Socket(new_sock))
+       if (!Init_Socket(new_sock)) {
+               Conf_Server[Server].conn_id = NONE;
                return;
+       }
 
        /* is a bind address configured? */
        res = ng_ipaddr_af(&Conf_Server[Server].bind_addr);
@@ -2165,6 +2169,7 @@ New_Server( int Server , ng_ipaddr_t *dest)
        if(( res != 0 ) && ( errno != EINPROGRESS )) {
                Log( LOG_CRIT, "Can't connect socket: %s!", strerror( errno ));
                close( new_sock );
+               Conf_Server[Server].conn_id = NONE;
                return;
        }
 
@@ -2173,12 +2178,14 @@ New_Server( int Server , ng_ipaddr_t *dest)
                    "Cannot allocate memory for server connection (socket %d)",
                    new_sock);
                close( new_sock );
+               Conf_Server[Server].conn_id = NONE;
                return;
        }
 
        if (!io_event_create( new_sock, IO_WANTWRITE, cb_connserver)) {
                Log(LOG_ALERT, "io_event_create(): could not add fd %d", strerror(errno));
                close(new_sock);
+               Conf_Server[Server].conn_id = NONE;
                return;
        }
 
@@ -2193,6 +2200,7 @@ New_Server( int Server , ng_ipaddr_t *dest)
        if (!c) {
                Log( LOG_ALERT, "Can't establish connection: can't create client structure!" );
                io_close(new_sock);
+               Conf_Server[Server].conn_id = NONE;
                return;
        }
 
index f0cb15045993b9a5df1d587f7d19d343c4cc6797..d76b47d4ba86dbf3969dfbae1544701c0e4d9608 100644 (file)
@@ -264,7 +264,7 @@ main(int argc, const char *argv[])
                /* Initialize the "main program": chroot environment, user and
                 * group ID, ... */
                if (!NGIRCd_Init(NGIRCd_NoDaemon)) {
-                       Log(LOG_ALERT, "Fatal: Initialization failed");
+                       Log(LOG_ALERT, "Fatal: Initialization failed, exiting!");
                        exit(1);
                }
 
@@ -673,9 +673,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
        }
 
        /* SSL initialization */
-       if (!ConnSSL_InitLibrary())
-               Log(LOG_WARNING,
-                   "Error during SSL initialization, continuing without SSL ...");
+       if (!ConnSSL_InitLibrary()) {
+               Log(LOG_ERR, "Error during SSL initialization!");
+               goto out;
+       }
 
        /* Change root */
        if (Conf_Chroot[0]) {