Make DSA_generate_parameters, and fix a couple of bug
[openssl.git] / ssl / s23_lib.c
index 8a9a9b63aa329d491d4678c61912c5e1648b8a93..e2c3bb47daf0fc5217f61d8b289ecc4348b08f8a 100644 (file)
@@ -77,7 +77,7 @@ static SSL_METHOD SSLv23_data= {
        ssl_undefined_function,
        ssl_undefined_function,
        ssl23_read,
-        (int (*)(struct ssl_st *, char *, int))ssl_undefined_function,
+       (int (*)(struct ssl_st *, char *, int))ssl_undefined_function,
        ssl23_write,
        ssl_undefined_function,
        ssl_undefined_function,
@@ -106,7 +106,11 @@ SSL_METHOD *sslv23_base_method(void)
 
 static int ssl23_num_ciphers(void)
        {
-       return(ssl3_num_ciphers()+ssl2_num_ciphers());
+       return(ssl3_num_ciphers()
+#ifndef NO_SSL2
+              + ssl2_num_ciphers()
+#endif
+           );
        }
 
 static SSL_CIPHER *ssl23_get_cipher(unsigned int u)
@@ -116,7 +120,11 @@ static SSL_CIPHER *ssl23_get_cipher(unsigned int u)
        if (u < uu)
                return(ssl3_get_cipher(u));
        else
+#ifndef NO_SSL2
                return(ssl2_get_cipher(u-uu));
+#else
+               return(NULL);
+#endif
        }
 
 /* This function needs to check if the ciphers required are actually
@@ -132,8 +140,10 @@ static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p)
                ((unsigned long)p[1]<<8L)|(unsigned long)p[2];
        c.id=id;
        cp=ssl3_get_cipher_by_char(p);
+#ifndef NO_SSL2
        if (cp == NULL)
                cp=ssl2_get_cipher_by_char(p);
+#endif
        return(cp);
        }