httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_init.c
Date Fri, 07 Jun 2002 12:51:50 GMT
trawick     2002/06/07 05:51:49

  Modified:    modules/ssl ssl_engine_init.c
  Log:
  make some small steps towards getting the post config hook
  to return an error rather than exiting directly
  
  Revision  Changes    Path
  1.101     +23 -12    httpd-2.0/modules/ssl/ssl_engine_init.c
  
  Index: ssl_engine_init.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_init.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- ssl_engine_init.c	4 Jun 2002 02:19:33 -0000	1.100
  +++ ssl_engine_init.c	7 Jun 2002 12:51:49 -0000	1.101
  @@ -141,8 +141,8 @@
       MODSSL_TMP_KEYS_FREE(mc, DH);
   }
   
  -static void ssl_tmp_key_init_rsa(server_rec *s,
  -                                 int bits, int idx)
  +static int ssl_tmp_key_init_rsa(server_rec *s,
  +                                int bits, int idx)
   {
       SSLModConfigRec *mc = myModConfig(s);
   
  @@ -152,13 +152,14 @@
           ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
                        "Init: Failed to generate temporary "
                        "%d bit RSA private key", bits);
  -        ssl_die();
  +        return !OK;
       }
   
  +    return OK;
   }
   
  -static void ssl_tmp_key_init_dh(server_rec *s,
  -                                int bits, int idx)
  +static int ssl_tmp_key_init_dh(server_rec *s,
  +                               int bits, int idx)
   {
       SSLModConfigRec *mc = myModConfig(s);
   
  @@ -168,8 +169,10 @@
           ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
                        "Init: Failed to generate temporary "
                        "%d bit DH parameters", bits);
  -        ssl_die();
  +        return !OK;
       }
  +
  +    return OK;
   }
   
   #define MODSSL_TMP_KEY_INIT_RSA(s, bits) \
  @@ -178,19 +181,25 @@
   #define MODSSL_TMP_KEY_INIT_DH(s, bits) \
       ssl_tmp_key_init_dh(s, bits, SSL_TMP_KEY_DH_##bits)
   
  -static void ssl_tmp_keys_init(server_rec *s)
  +static int ssl_tmp_keys_init(server_rec *s)
   {
       ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
                    "Init: Generating temporary RSA private keys (512/1024 bits)");
   
  -    MODSSL_TMP_KEY_INIT_RSA(s, 512);
  -    MODSSL_TMP_KEY_INIT_RSA(s, 1024);
  +    if (MODSSL_TMP_KEY_INIT_RSA(s, 512) ||
  +        MODSSL_TMP_KEY_INIT_RSA(s, 1024)) {
  +        return !OK;
  +    }
   
       ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
                    "Init: Generating temporary DH parameters (512/1024 bits)");
   
  -    MODSSL_TMP_KEY_INIT_DH(s, 512);
  -    MODSSL_TMP_KEY_INIT_DH(s, 1024);
  +    if (MODSSL_TMP_KEY_INIT_DH(s, 512) ||
  +        MODSSL_TMP_KEY_INIT_DH(s, 1024)) {
  +        return !OK;
  +    }
  +
  +    return OK;
   }
   
   /*
  @@ -278,7 +287,9 @@
        */
       ssl_pphrase_Handle(base_server, ptemp);
   
  -    ssl_tmp_keys_init(base_server);
  +    if (ssl_tmp_keys_init(base_server)) {
  +        return !OK;
  +    }
   
       /*
        * SSL external crypto device ("engine") support
  
  
  

Mime
View raw message