Make -DKSSL_DEBUG work again.
This commit is contained in:
parent
ea725a66c9
commit
2c17b493b1
@ -111,8 +111,7 @@ static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
|||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *cp;
|
printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", (unsigned long)ctx, ctx->buf_len);
|
||||||
printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", ctx, ctx->buf_len);
|
|
||||||
printf("\t iv= ");
|
printf("\t iv= ");
|
||||||
for(i=0;i<8;i++)
|
for(i=0;i<8;i++)
|
||||||
printf("%02X",ctx->iv[i]);
|
printf("%02X",ctx->iv[i]);
|
||||||
@ -216,7 +215,7 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
|||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
printf("des_ede3_init_key(ctx=%lx)\n", ctx);
|
printf("des_ede3_init_key(ctx=%lx)\n", (unsigned long)ctx);
|
||||||
printf("\tKEY= ");
|
printf("\tKEY= ");
|
||||||
for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n");
|
for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n");
|
||||||
printf("\t IV= ");
|
printf("\t IV= ");
|
||||||
|
17
ssl/d1_enc.c
17
ssl/d1_enc.c
@ -120,7 +120,9 @@
|
|||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
#ifdef KSSL_DEBUG
|
||||||
|
#include <openssl/des.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int dtls1_enc(SSL *s, int send)
|
int dtls1_enc(SSL *s, int send)
|
||||||
{
|
{
|
||||||
@ -202,10 +204,11 @@ int dtls1_enc(SSL *s, int send)
|
|||||||
{
|
{
|
||||||
unsigned long ui;
|
unsigned long ui;
|
||||||
printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
|
printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
|
||||||
ds,rec->data,rec->input,l);
|
(void *)ds,rec->data,rec->input,l);
|
||||||
printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%d %d], %d iv_len\n",
|
printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%ld %ld], %d iv_len\n",
|
||||||
ds->buf_len, ds->cipher->key_len,
|
ds->buf_len, ds->cipher->key_len,
|
||||||
DES_KEY_SZ, DES_SCHEDULE_SZ,
|
(unsigned long)DES_KEY_SZ,
|
||||||
|
(unsigned long)DES_SCHEDULE_SZ,
|
||||||
ds->cipher->iv_len);
|
ds->cipher->iv_len);
|
||||||
printf("\t\tIV: ");
|
printf("\t\tIV: ");
|
||||||
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
|
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
|
||||||
@ -230,10 +233,10 @@ int dtls1_enc(SSL *s, int send)
|
|||||||
|
|
||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
{
|
{
|
||||||
unsigned long i;
|
unsigned long ki;
|
||||||
printf("\trec->data=");
|
printf("\trec->data=");
|
||||||
for (i=0; i<l; i++)
|
for (ki=0; ki<l; ki++)
|
||||||
printf(" %02x", rec->data[i]); printf("\n");
|
printf(" %02x", rec->data[ki]); printf("\n");
|
||||||
}
|
}
|
||||||
#endif /* KSSL_DEBUG */
|
#endif /* KSSL_DEBUG */
|
||||||
|
|
||||||
|
@ -1006,7 +1006,7 @@ int ssl3_get_server_certificate(SSL *s)
|
|||||||
== (SSL_aKRB5|SSL_kKRB5))? 0: 1;
|
== (SSL_aKRB5|SSL_kKRB5))? 0: 1;
|
||||||
|
|
||||||
#ifdef KSSL_DEBUG
|
#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("ssl_cert_type(x,pkey) = %d\n", ssl_cert_type(x,pkey));
|
||||||
printf("cipher, alg, nc = %s, %lx, %d\n", s->s3->tmp.new_cipher->name,
|
printf("cipher, alg, nc = %s, %lx, %d\n", s->s3->tmp.new_cipher->name,
|
||||||
s->s3->tmp.new_cipher->algorithms, need_cert);
|
s->s3->tmp.new_cipher->algorithms, need_cert);
|
||||||
|
36
ssl/t1_enc.c
36
ssl/t1_enc.c
@ -115,6 +115,9 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
|
#ifdef KSSL_DEBUG
|
||||||
|
#include <openssl/des.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec,
|
static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec,
|
||||||
int sec_len, unsigned char *seed, int seed_len,
|
int sec_len, unsigned char *seed, int seed_len,
|
||||||
@ -251,15 +254,15 @@ int tls1_change_cipher_state(SSL *s, int which)
|
|||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
printf("tls1_change_cipher_state(which= %d) w/\n", which);
|
printf("tls1_change_cipher_state(which= %d) w/\n", which);
|
||||||
printf("\talg= %ld, comp= %p\n", s->s3->tmp.new_cipher->algorithms,
|
printf("\talg= %ld, comp= %p\n", s->s3->tmp.new_cipher->algorithms,
|
||||||
comp);
|
(void *)comp);
|
||||||
printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", c);
|
printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", (void *)c);
|
||||||
printf("\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n",
|
printf("\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n",
|
||||||
c->nid,c->block_size,c->key_len,c->iv_len);
|
c->nid,c->block_size,c->key_len,c->iv_len);
|
||||||
printf("\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length);
|
printf("\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length);
|
||||||
{
|
{
|
||||||
int i;
|
int ki;
|
||||||
for (i=0; i<s->s3->tmp.key_block_length; i++)
|
for (ki=0; ki<s->s3->tmp.key_block_length; ki++)
|
||||||
printf("%02x", key_block[i]); printf("\n");
|
printf("%02x", key_block[ki]); printf("\n");
|
||||||
}
|
}
|
||||||
#endif /* KSSL_DEBUG */
|
#endif /* KSSL_DEBUG */
|
||||||
|
|
||||||
@ -415,11 +418,13 @@ printf("which = %04X\nmac key=",which);
|
|||||||
s->session->key_arg_length=0;
|
s->session->key_arg_length=0;
|
||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
{
|
{
|
||||||
int i;
|
int ki;
|
||||||
printf("EVP_CipherInit_ex(dd,c,key=,iv=,which)\n");
|
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("\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");
|
printf("\n");
|
||||||
}
|
}
|
||||||
#endif /* KSSL_DEBUG */
|
#endif /* KSSL_DEBUG */
|
||||||
@ -592,10 +597,11 @@ int tls1_enc(SSL *s, int send)
|
|||||||
{
|
{
|
||||||
unsigned long ui;
|
unsigned long ui;
|
||||||
printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
|
printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
|
||||||
ds,rec->data,rec->input,l);
|
(void *)ds,rec->data,rec->input,l);
|
||||||
printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%d %d], %d iv_len\n",
|
printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%ld %ld], %d iv_len\n",
|
||||||
ds->buf_len, ds->cipher->key_len,
|
ds->buf_len, ds->cipher->key_len,
|
||||||
DES_KEY_SZ, DES_SCHEDULE_SZ,
|
(unsigned long)DES_KEY_SZ,
|
||||||
|
(unsigned long)DES_SCHEDULE_SZ,
|
||||||
ds->cipher->iv_len);
|
ds->cipher->iv_len);
|
||||||
printf("\t\tIV: ");
|
printf("\t\tIV: ");
|
||||||
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
|
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
|
||||||
@ -620,10 +626,10 @@ int tls1_enc(SSL *s, int send)
|
|||||||
|
|
||||||
#ifdef KSSL_DEBUG
|
#ifdef KSSL_DEBUG
|
||||||
{
|
{
|
||||||
unsigned long i;
|
unsigned long ki;
|
||||||
printf("\trec->data=");
|
printf("\trec->data=");
|
||||||
for (i=0; i<l; i++)
|
for (ki=0; ki<l; i++)
|
||||||
printf(" %02x", rec->data[i]); printf("\n");
|
printf(" %02x", rec->data[ki]); printf("\n");
|
||||||
}
|
}
|
||||||
#endif /* KSSL_DEBUG */
|
#endif /* KSSL_DEBUG */
|
||||||
|
|
||||||
@ -807,7 +813,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
|
|||||||
unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH];
|
unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH];
|
||||||
|
|
||||||
#ifdef KSSL_DEBUG
|
#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 */
|
#endif /* KSSL_DEBUG */
|
||||||
|
|
||||||
/* Setup the stuff to munge */
|
/* Setup the stuff to munge */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user