Index: openssl/ssl/d1_enc.c |
=================================================================== |
--- openssl/ssl/d1_enc.c (revision 105093) |
+++ openssl/ssl/d1_enc.c (working copy) |
@@ -136,8 +136,12 @@ |
if (send) |
{ |
- if (s->write_hash != NULL) |
- n=EVP_MD_size(s->write_hash); |
+ if (EVP_MD_CTX_md(s->write_hash)) |
+ { |
+ n=EVP_MD_CTX_size(s->write_hash); |
+ if (n < 0) |
+ return -1; |
+ } |
ds=s->enc_write_ctx; |
rec= &(s->s3->wrec); |
if (s->enc_write_ctx == NULL) |
@@ -158,8 +162,12 @@ |
} |
else |
{ |
- if (s->read_hash != NULL) |
- n=EVP_MD_size(s->read_hash); |
+ if (EVP_MD_CTX_md(s->read_hash)) |
+ { |
+ n=EVP_MD_CTX_size(s->read_hash); |
+ if (n < 0) |
+ return -1; |
+ } |
ds=s->enc_read_ctx; |
rec= &(s->s3->rrec); |
if (s->enc_read_ctx == NULL) |
@@ -206,11 +214,10 @@ |
{ |
unsigned long ui; |
printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n", |
- (void *)ds,rec->data,rec->input,l); |
- printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%ld %ld], %d iv_len\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, |
- (unsigned long)DES_KEY_SZ, |
- (unsigned long)DES_SCHEDULE_SZ, |
+ DES_KEY_SZ, DES_SCHEDULE_SZ, |
ds->cipher->iv_len); |
printf("\t\tIV: "); |
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]); |
@@ -224,21 +231,17 @@ |
if (!send) |
{ |
if (l == 0 || l%bs != 0) |
- { |
- SSLerr(SSL_F_DTLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); |
- ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); |
- return 0; |
- } |
+ return -1; |
} |
EVP_Cipher(ds,rec->data,rec->input,l); |
#ifdef KSSL_DEBUG |
{ |
- unsigned long ki; |
+ unsigned long i; |
printf("\trec->data="); |
- for (ki=0; ki<l; ki++) |
- printf(" %02x", rec->data[ki]); printf("\n"); |
+ for (i=0; i<l; i++) |
+ printf(" %02x", rec->data[i]); printf("\n"); |
} |
#endif /* KSSL_DEBUG */ |