projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PR: 1647
[oweals/openssl.git]
/
ssl
/
d1_enc.c
diff --git
a/ssl/d1_enc.c
b/ssl/d1_enc.c
index 7b369644ff8fbbbe8247772e4ade44706c4270c4..cf3332e4e43d530a6af491d0e056fac5ecca5f90 100644
(file)
--- a/
ssl/d1_enc.c
+++ b/
ssl/d1_enc.c
@@
-115,12
+115,16
@@
#include <stdio.h>
#include "ssl_locl.h"
#include <stdio.h>
#include "ssl_locl.h"
+#ifndef OPENSSL_NO_COMP
#include <openssl/comp.h>
#include <openssl/comp.h>
+#endif
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/md5.h>
#include <openssl/rand.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/md5.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)
{
@@
-146,7
+150,10
@@
int dtls1_enc(SSL *s, int send)
fprintf(stderr, "%s:%d: rec->data != rec->input\n",
__FILE__, __LINE__);
else if ( EVP_CIPHER_block_size(ds->cipher) > 1)
fprintf(stderr, "%s:%d: rec->data != rec->input\n",
__FILE__, __LINE__);
else if ( EVP_CIPHER_block_size(ds->cipher) > 1)
- RAND_bytes(rec->input, EVP_CIPHER_block_size(ds->cipher));
+ {
+ if (!RAND_bytes(rec->input, EVP_CIPHER_block_size(ds->cipher)))
+ return -1;
+ }
}
}
else
}
}
else
@@
-199,10
+206,11
@@
int dtls1_enc(SSL *s, int send)
{
unsigned long ui;
printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n",
{
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",
+
(void *)
ds,rec->data,rec->input,l);
+ printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%
ld %l
d], %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);
printf("\t\tIV: ");
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
ds->cipher->iv_len);
printf("\t\tIV: ");
for (i=0; i<ds->cipher->iv_len; i++) printf("%02X", ds->iv[i]);
@@
-217,7
+225,7
@@
int dtls1_enc(SSL *s, int send)
{
if (l == 0 || l%bs != 0)
{
{
if (l == 0 || l%bs != 0)
{
- SSLerr(SSL_F_TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG);
+ SSLerr(SSL_F_
D
TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG);
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED);
return 0;
}
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED);
return 0;
}
@@
-227,10
+235,10
@@
int dtls1_enc(SSL *s, int send)
#ifdef KSSL_DEBUG
{
#ifdef KSSL_DEBUG
{
- unsigned long i;
+ unsigned long
k
i;
printf("\trec->data=");
printf("\trec->data=");
- for (
i=0; i<l;
i++)
- printf(" %02x", rec->data[i]); printf("\n");
+ for (
ki=0; ki<l; k
i++)
+ printf(" %02x", rec->data[
k
i]); printf("\n");
}
#endif /* KSSL_DEBUG */
}
#endif /* KSSL_DEBUG */