diff options
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
| -rw-r--r-- | src/lib/libssl/t1_enc.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index 3c4dec76d7..7cb3e29a41 100644 --- a/src/lib/libssl/t1_enc.c +++ b/src/lib/libssl/t1_enc.c | |||
| @@ -111,10 +111,15 @@ | |||
| 111 | 111 | ||
| 112 | #include <stdio.h> | 112 | #include <stdio.h> |
| 113 | #include "ssl_locl.h" | 113 | #include "ssl_locl.h" |
| 114 | #ifndef OPENSSL_NO_COMP | ||
| 114 | #include <openssl/comp.h> | 115 | #include <openssl/comp.h> |
| 116 | #endif | ||
| 115 | #include <openssl/evp.h> | 117 | #include <openssl/evp.h> |
| 116 | #include <openssl/hmac.h> | 118 | #include <openssl/hmac.h> |
| 117 | #include <openssl/md5.h> | 119 | #include <openssl/md5.h> |
| 120 | #ifdef KSSL_DEBUG | ||
| 121 | #include <openssl/des.h> | ||
| 122 | #endif | ||
| 118 | 123 | ||
| 119 | static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec, | 124 | static void tls1_P_hash(const EVP_MD *md, const unsigned char *sec, |
| 120 | int sec_len, unsigned char *seed, int seed_len, | 125 | int sec_len, unsigned char *seed, int seed_len, |
| @@ -251,15 +256,15 @@ int tls1_change_cipher_state(SSL *s, int which) | |||
| 251 | #ifdef KSSL_DEBUG | 256 | #ifdef KSSL_DEBUG |
| 252 | printf("tls1_change_cipher_state(which= %d) w/\n", which); | 257 | printf("tls1_change_cipher_state(which= %d) w/\n", which); |
| 253 | printf("\talg= %ld, comp= %p\n", s->s3->tmp.new_cipher->algorithms, | 258 | printf("\talg= %ld, comp= %p\n", s->s3->tmp.new_cipher->algorithms, |
| 254 | comp); | 259 | (void *)comp); |
| 255 | printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", c); | 260 | printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", (void *)c); |
| 256 | printf("\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n", | 261 | printf("\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n", |
| 257 | c->nid,c->block_size,c->key_len,c->iv_len); | 262 | c->nid,c->block_size,c->key_len,c->iv_len); |
| 258 | printf("\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length); | 263 | printf("\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length); |
| 259 | { | 264 | { |
| 260 | int i; | 265 | int ki; |
| 261 | for (i=0; i<s->s3->tmp.key_block_length; i++) | 266 | for (ki=0; ki<s->s3->tmp.key_block_length; ki++) |
| 262 | printf("%02x", key_block[i]); printf("\n"); | 267 | printf("%02x", key_block[ki]); printf("\n"); |
| 263 | } | 268 | } |
| 264 | #endif /* KSSL_DEBUG */ | 269 | #endif /* KSSL_DEBUG */ |
| 265 | 270 | ||
| @@ -415,11 +420,13 @@ printf("which = %04X\nmac key=",which); | |||
| 415 | s->session->key_arg_length=0; | 420 | s->session->key_arg_length=0; |
| 416 | #ifdef KSSL_DEBUG | 421 | #ifdef KSSL_DEBUG |
| 417 | { | 422 | { |
| 418 | int i; | 423 | int ki; |
| 419 | printf("EVP_CipherInit_ex(dd,c,key=,iv=,which)\n"); | 424 | printf("EVP_CipherInit_ex(dd,c,key=,iv=,which)\n"); |
| 420 | printf("\tkey= "); for (i=0; i<c->key_len; i++) printf("%02x", key[i]); | 425 | printf("\tkey= "); |
| 426 | for (ki=0; ki<c->key_len; ki++) printf("%02x", key[ki]); | ||
| 421 | printf("\n"); | 427 | printf("\n"); |
| 422 | printf("\t iv= "); for (i=0; i<c->iv_len; i++) printf("%02x", iv[i]); | 428 | printf("\t iv= "); |
| 429 | for (ki=0; ki<c->iv_len; ki++) printf("%02x", iv[ki]); | ||
| 423 | printf("\n"); | 430 | printf("\n"); |
| 424 | } | 431 | } |
| 425 | #endif /* KSSL_DEBUG */ | 432 | #endif /* KSSL_DEBUG */ |
| @@ -592,10 +599,11 @@ int tls1_enc(SSL *s, int send) | |||
| 592 | { | 599 | { |
| 593 | unsigned long ui; | 600 | unsigned long ui; |
| 594 | printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n", | 601 | printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n", |
| 595 | ds,rec->data,rec->input,l); | 602 | (void *)ds,rec->data,rec->input,l); |
| 596 | printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%d %d], %d iv_len\n", | 603 | printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%ld %ld], %d iv_len\n", |
| 597 | ds->buf_len, ds->cipher->key_len, | 604 | ds->buf_len, ds->cipher->key_len, |
| 598 | DES_KEY_SZ, DES_SCHEDULE_SZ, | 605 | (unsigned long)DES_KEY_SZ, |
| 606 | (unsigned long)DES_SCHEDULE_SZ, | ||
| 599 | ds->cipher->iv_len); | 607 | ds->cipher->iv_len); |
| 600 | printf("\t\tIV: "); | 608 | printf("\t\tIV: "); |
| 601 | for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]); | 609 | for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]); |
| @@ -620,10 +628,10 @@ int tls1_enc(SSL *s, int send) | |||
| 620 | 628 | ||
| 621 | #ifdef KSSL_DEBUG | 629 | #ifdef KSSL_DEBUG |
| 622 | { | 630 | { |
| 623 | unsigned long i; | 631 | unsigned long ki; |
| 624 | printf("\trec->data="); | 632 | printf("\trec->data="); |
| 625 | for (i=0; i<l; i++) | 633 | for (ki=0; ki<l; i++) |
| 626 | printf(" %02x", rec->data[i]); printf("\n"); | 634 | printf(" %02x", rec->data[ki]); printf("\n"); |
| 627 | } | 635 | } |
| 628 | #endif /* KSSL_DEBUG */ | 636 | #endif /* KSSL_DEBUG */ |
| 629 | 637 | ||
| @@ -807,7 +815,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, | |||
| 807 | unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH]; | 815 | unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH]; |
| 808 | 816 | ||
| 809 | #ifdef KSSL_DEBUG | 817 | #ifdef KSSL_DEBUG |
| 810 | printf ("tls1_generate_master_secret(%p,%p, %p, %d)\n", s,out, p,len); | 818 | printf ("tls1_generate_master_secret(%p,%p, %p, %d)\n", (void *)s,out, p,len); |
| 811 | #endif /* KSSL_DEBUG */ | 819 | #endif /* KSSL_DEBUG */ |
| 812 | 820 | ||
| 813 | /* Setup the stuff to munge */ | 821 | /* Setup the stuff to munge */ |
