Clear warnings/errors within CIPHER_DEBUG code sections
authorRichard Levitte <levitte@openssl.org>
Tue, 16 Dec 2014 01:54:03 +0000 (02:54 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 17 Dec 2014 13:17:54 +0000 (14:17 +0100)
Reviewed-by: Andy Polyakov <appro@openssl.org>
ssl/s3_lib.c
ssl/s3_srvr.c
ssl/ssl_ciph.c

index 713de7295ece85a4c6e73d747bfdfa9dc3812a0f..b0d69edc12e3ed04ee9eaa8d7837cba6c928dd28 100644 (file)
@@ -4114,17 +4114,17 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
 #endif
 
 #ifdef CIPHER_DEBUG
-       printf("Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr);
+       fprintf(stderr, "Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr);
        for(i=0 ; i < sk_SSL_CIPHER_num(srvr) ; ++i)
                {
                c=sk_SSL_CIPHER_value(srvr,i);
-               printf("%p:%s\n",(void *)c,c->name);
+               fprintf(stderr, "%p:%s\n",(void *)c,c->name);
                }
-       printf("Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt);
+       fprintf(stderr, "Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt);
        for(i=0 ; i < sk_SSL_CIPHER_num(clnt) ; ++i)
            {
            c=sk_SSL_CIPHER_value(clnt,i);
-           printf("%p:%s\n",(void *)c,c->name);
+           fprintf(stderr, "%p:%s\n",(void *)c,c->name);
            }
 #endif
 
@@ -4189,7 +4189,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
                        {
                        ok = (alg_k & emask_k) && (alg_a & emask_a);
 #ifdef CIPHER_DEBUG
-                       printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a,
+                       fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a,
                               (void *)c,c->name);
 #endif
                        }
@@ -4197,7 +4197,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
                        {
                        ok = (alg_k & mask_k) && (alg_a & mask_a);
 #ifdef CIPHER_DEBUG
-                       printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c,
+                       fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c,
                               c->name);
 #endif
                        }
index 2290ed60e50ba1bb1cf566581afed5775e525982..72ec51af1ae7a62a38f16f4091c88837138ef9c5 100644 (file)
@@ -1183,14 +1183,15 @@ int ssl3_get_client_hello(SSL *s)
                id=s->session->cipher->id;
 
 #ifdef CIPHER_DEBUG
-               printf("client sent %d ciphers\n",sk_num(ciphers));
+               fprintf(stderr,"client sent %d ciphers\n",sk_SSL_CIPHER_num(ciphers));
 #endif
                for (i=0; i<sk_SSL_CIPHER_num(ciphers); i++)
                        {
                        c=sk_SSL_CIPHER_value(ciphers,i);
 #ifdef CIPHER_DEBUG
-                       printf("client [%2d of %2d]:%s\n",
-                               i,sk_num(ciphers),SSL_CIPHER_get_name(c));
+                       fprintf(stderr,"client [%2d of %2d]:%s\n",
+                               i,sk_SSL_CIPHER_num(ciphers),
+                               SSL_CIPHER_get_name(c));
 #endif
                        if (c->id == id)
                                {
index 0ad11dd1b7d00e7f1a26cf0854a5b8df47dcf901..726ba521e7a07f4a7804b4d784bd23fb02c8d32c 100644 (file)
@@ -954,7 +954,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
        int reverse = 0;
 
 #ifdef CIPHER_DEBUG
-       printf("Applying rule %d with %08lx/%08lx/%08lx/%08lx/%08lx %08lx (%d)\n",
+       fprintf(stderr, "Applying rule %d with %08lx/%08lx/%08lx/%08lx/%08lx %08lx (%d)\n",
                rule, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength, strength_bits);
 #endif
 
@@ -1000,7 +1000,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
                else
                        {
 #ifdef CIPHER_DEBUG
-                       printf("\nName: %s:\nAlgo = %08lx/%08lx/%08lx/%08lx/%08lx Algo_strength = %08lx\n", cp->name, cp->algorithm_mkey, cp->algorithm_auth, cp->algorithm_enc, cp->algorithm_mac, cp->algorithm_ssl, cp->algo_strength);
+                       fprintf(stderr, "\nName: %s:\nAlgo = %08lx/%08lx/%08lx/%08lx/%08lx Algo_strength = %08lx\n", cp->name, cp->algorithm_mkey, cp->algorithm_auth, cp->algorithm_enc, cp->algorithm_mac, cp->algorithm_ssl, cp->algo_strength);
 #endif
 #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
                        if (cipher_id && cipher_id != cp->id)
@@ -1023,7 +1023,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id,
                        }
 
 #ifdef CIPHER_DEBUG
-               printf("Action = %d\n", rule);
+               fprintf(stderr, "Action = %d\n", rule);
 #endif
 
                /* add the cipher if it has not been added yet. */
@@ -1609,7 +1609,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
                        {
                        sk_SSL_CIPHER_push(cipherstack, curr->cipher);
 #ifdef CIPHER_DEBUG
-                       printf("<%s>\n",curr->cipher->name);
+                       fprintf(stderr, "<%s>\n",curr->cipher->name);
 #endif
                        }
                }