Make -DKSSL_DEBUG work again.
authorDr. Stephen Henson <steve@openssl.org>
Mon, 10 Nov 2008 19:08:37 +0000 (19:08 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 10 Nov 2008 19:08:37 +0000 (19:08 +0000)
crypto/evp/e_des3.c
ssl/d1_enc.c
ssl/s3_clnt.c
ssl/t1_enc.c

index 059ad77118c22858b4150b64f201a5105aedba2a..03ef84cc4371186970d2a6f5c55d96abe253bf6a 100644 (file)
@@ -122,8 +122,8 @@ static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 #ifdef KSSL_DEBUG
        {
         int i;
-        char *cp;
-       printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", ctx, ctx->buf_len);
+       printf("des_ede_cbc_cipher(ctx=%lx, buflen=%ld)\n", (unsigned long)ctx,
+                                               (unsigned long)ctx->buf_len);
        printf("\t iv= ");
         for(i=0;i<8;i++)
                 printf("%02X",ctx->iv[i]);
@@ -257,7 +257,7 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 #ifdef KSSL_DEBUG
        {
         int i;
-        printf("des_ede3_init_key(ctx=%lx)\n", ctx);
+        printf("des_ede3_init_key(ctx=%lx)\n", (unsigned long)ctx);
        printf("\tKEY= ");
         for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n");
        printf("\t IV= ");
index ea5e12ee070e666c125add33a9dd780fbe464740..db7dad799bbff89aa15eb6a62ffbb8d67fe92b4d 100644 (file)
@@ -204,11 +204,13 @@ int dtls1_enc(SSL *s, int send)
                {
                 unsigned long ui;
                printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
-                        ds,rec->data,rec->input,l);
-               printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%d %d], %d iv_len\n",
-                        ds->buf_len, ds->cipher->key_len,
-                        DES_KEY_SZ, DES_SCHEDULE_SZ,
-                        ds->cipher->iv_len);
+                        (void *)ds,rec->data,rec->input,l);
+               printf("\tEVP_CIPHER_CTX: %ld buf_len, %ld key_len [%ld %ld], %ld iv_len\n",
+                        (unsigned long)ds->buf_len,
+                       (unsigned long)ds->cipher->key_len,
+                       (unsigned long)DES_KEY_SZ,
+                       (unsigned long)DES_SCHEDULE_SZ,
+                        (unsigned long)ds->cipher->iv_len);
                printf("\t\tIV: ");
                for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
                printf("\n");
@@ -232,10 +234,10 @@ int dtls1_enc(SSL *s, int send)
 
 #ifdef KSSL_DEBUG
                {
-                unsigned long i;
+                unsigned long ki;
                 printf("\trec->data=");
-               for (i=0; i<l; i++)
-                        printf(" %02x", rec->data[i]);  printf("\n");
+               for (ki=0; ki<l; i++)
+                        printf(" %02x", rec->data[ki]);  printf("\n");
                 }
 #endif /* KSSL_DEBUG */
 
index aae133429cba14997c7e5f57e7c827008d48d7b3..fadb763f71f8d3c2084ca805eb307df96aa0968c 100644 (file)
@@ -1034,7 +1034,7 @@ int ssl3_get_server_certificate(SSL *s)
                    ? 0 : 1;
 
 #ifdef KSSL_DEBUG
-       printf("pkey,x = %p, %p\n", pkey,x);
+       printf("pkey,x = %p, %p\n", (void *)pkey,(void *)x);
        printf("ssl_cert_type(x,pkey) = %d\n", ssl_cert_type(x,pkey));
        printf("cipher, alg, nc = %s, %lx, %lx, %d\n", s->s3->tmp.new_cipher->name,
                s->s3->tmp.new_cipher->algorithm_mkey, s->s3->tmp.new_cipher->algorithm_auth, need_cert);
index 3a349920d9cd2144e73472f43b98f46fc59c74cf..f19d68c08ab9e62cfe7b59588e3b92ae851dcf4a 100644 (file)
@@ -311,15 +311,16 @@ int tls1_change_cipher_state(SSL *s, int which)
        printf("\talg= %ld/%ld, comp= %p\n",
               s->s3->tmp.new_cipher->algorithm_mkey,
               s->s3->tmp.new_cipher->algorithm_auth,
-              comp);
-       printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", c);
-       printf("\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n",
-                c->nid,c->block_size,c->key_len,c->iv_len);
+              (void *)comp);
+       printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", (void *)c);
+       printf("\tevp_cipher: nid, blksz= %d, %ld, keylen=%ld, ivlen=%ld\n",
+                c->nid,(unsigned long)c->block_size,
+               (unsigned long)c->key_len,(unsigned long)c->iv_len);
        printf("\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length);
        {
-        int i;
-        for (i=0; i<s->s3->tmp.key_block_length; i++)
-               printf("%02x", key_block[i]);  printf("\n");
+        int ki;
+        for (ki=0; ki<s->s3->tmp.key_block_length; ki++)
+               printf("%02x", key_block[ki]);  printf("\n");
         }
 #endif /* KSSL_DEBUG */
 
@@ -484,11 +485,13 @@ printf("which = %04X\nmac key=",which);
        s->session->key_arg_length=0;
 #ifdef KSSL_DEBUG
        {
-        int i;
+        int ki;
        printf("EVP_CipherInit_ex(dd,c,key=,iv=,which)\n");
-       printf("\tkey= "); for (i=0; i<c->key_len; i++) printf("%02x", key[i]);
+       printf("\tkey= ");
+       for (ki=0; ki<c->key_len; ki++) printf("%02x", key[ki]);
        printf("\n");
-       printf("\t iv= "); for (i=0; i<c->iv_len; i++) printf("%02x", iv[i]);
+       printf("\t iv= ");
+       for (ki=0; ki<c->iv_len; ki++) printf("%02x", iv[ki]);
        printf("\n");
        }
 #endif /* KSSL_DEBUG */
@@ -663,11 +666,13 @@ int tls1_enc(SSL *s, int send)
                {
                 unsigned long ui;
                printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
-                        ds,rec->data,rec->input,l);
-               printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%d %d], %d iv_len\n",
-                        ds->buf_len, ds->cipher->key_len,
-                        DES_KEY_SZ, DES_SCHEDULE_SZ,
-                        ds->cipher->iv_len);
+                        (void *)ds,rec->data,rec->input,l);
+               printf("\tEVP_CIPHER_CTX: %ld buf_len, %ld key_len [%ld %ld], %ld iv_len\n",
+                        (unsigned long)ds->buf_len,
+                       (unsigned long)ds->cipher->key_len,
+                        (unsigned long)DES_KEY_SZ,
+                       (unsigned long)DES_SCHEDULE_SZ,
+                        (unsigned long)ds->cipher->iv_len);
                printf("\t\tIV: ");
                for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
                printf("\n");
@@ -691,10 +696,10 @@ int tls1_enc(SSL *s, int send)
 
 #ifdef KSSL_DEBUG
                {
-                unsigned long i;
+                unsigned long ki;
                 printf("\trec->data=");
-               for (i=0; i<l; i++)
-                        printf(" %02x", rec->data[i]);  printf("\n");
+               for (ki=0; ki<l; i++)
+                        printf(" %02x", rec->data[ki]);  printf("\n");
                 }
 #endif /* KSSL_DEBUG */
 
@@ -917,7 +922,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
        int col = 0, sol = 0;
 
 #ifdef KSSL_DEBUG
-       printf ("tls1_generate_master_secret(%p,%p, %p, %d)\n", s,out, p,len);
+       printf ("tls1_generate_master_secret(%p,%p, %p, %d)\n", (void *)s,out, p,len);
 #endif /* KSSL_DEBUG */
 
 #ifdef TLSEXT_TYPE_opaque_prf_input