This commit was manufactured by cvs2svn to create branch
[oweals/openssl.git] / ssl / ssl_ciph.c
index 78251d9f9ebf81eae6d7c20a2b2f40bb54603a00..b68ed81e5227626bffe6297c30bb51903571512e 100644 (file)
@@ -161,7 +161,6 @@ static int init_ciphers=1;
 
 static void load_ciphers(void)
        {
-       init_ciphers=0;
        ssl_cipher_methods[SSL_ENC_DES_IDX]= 
                EVP_get_cipherbyname(SN_des_cbc);
        ssl_cipher_methods[SSL_ENC_3DES_IDX]=
@@ -185,9 +184,10 @@ static void load_ciphers(void)
                EVP_get_digestbyname(SN_md5);
        ssl_digest_methods[SSL_MD_SHA1_IDX]=
                EVP_get_digestbyname(SN_sha1);
+       init_ciphers=0;
        }
 
-int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc,
+int ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc,
             const EVP_MD **md, SSL_COMP **comp)
        {
        int i;
@@ -363,7 +363,7 @@ static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method,
                /* drop those that use any of that is not available */
 #ifdef OPENSSL_FIPS
                if ((c != NULL) && c->valid && !(c->algorithms & mask)
-                       && (!FIPS_mode || (c->algo_strength & SSL_FIPS)))
+                       && (!FIPS_mode() || (c->algo_strength & SSL_FIPS)))
 #else
                if ((c != NULL) && c->valid && !(c->algorithms & mask))
 #endif
@@ -862,7 +862,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
        for (curr = head; curr != NULL; curr = curr->next)
                {
 #ifdef OPENSSL_FIPS
-               if (curr->active && (!FIPS_mode || curr->cipher->algo_strength & SSL_FIPS))
+               if (curr->active && (!FIPS_mode() || curr->cipher->algo_strength & SSL_FIPS))
 #else
                if (curr->active)
 #endif
@@ -1065,7 +1065,7 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
        return(buf);
        }
 
-char *SSL_CIPHER_get_version(SSL_CIPHER *c)
+char *SSL_CIPHER_get_version(const SSL_CIPHER *c)
        {
        int i;
 
@@ -1080,7 +1080,7 @@ char *SSL_CIPHER_get_version(SSL_CIPHER *c)
        }
 
 /* return the actual cipher being used */
-const char *SSL_CIPHER_get_name(SSL_CIPHER *c)
+const char *SSL_CIPHER_get_name(const SSL_CIPHER *c)
        {
        if (c != NULL)
                return(c->name);
@@ -1088,7 +1088,7 @@ const char *SSL_CIPHER_get_name(SSL_CIPHER *c)
        }
 
 /* number of bits for symmetric cipher */
-int SSL_CIPHER_get_bits(SSL_CIPHER *c, int *alg_bits)
+int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits)
        {
        int ret=0;