From be9419edf44c313e9cafd7bc2df4468720e695f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Tue, 9 Jul 2002 08:48:49 +0000 Subject: [PATCH] emtpy fragments are not necessary for SSL_eNULL (but noone uses it anyway) fix t1_enc.c: use OPENSSL_NO_RC4, not NO_RC4 --- ssl/s3_enc.c | 10 ++++++++-- ssl/t1_enc.c | 14 ++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index 72ac8b6913..2bb5be49f1 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -385,10 +385,16 @@ int ssl3_setup_key_block(SSL *s) */ s->s3->need_empty_fragments = 1; + if (s->session->cipher != NULL) + { + if ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_eNULL) + s->s3->need_empty_fragments = 0; + #ifndef OPENSSL_NO_RC4 - if ((s->session->cipher != NULL) && ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_RC4)) - s->s3->need_empty_fragments = 0; + if ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_RC4) + s->s3->need_empty_fragments = 0; #endif + } } return ret; diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index ecd2d6cbb5..ff45b87d5b 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -490,12 +490,18 @@ printf("\nkey block\n"); */ s->s3->need_empty_fragments = 1; -#ifndef NO_RC4 - if ((s->session->cipher != NULL) && ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_RC4)) - s->s3->need_empty_fragments = 0; + if (s->session->cipher != NULL) + { + if ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_eNULL) + s->s3->need_empty_fragments = 0; + +#ifndef OPENSSL_NO_RC4 + if ((s->session->cipher->algorithms & SSL_ENC_MASK) == SSL_RC4) + s->s3->need_empty_fragments = 0; #endif + } } - + return(1); err: SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK,ERR_R_MALLOC_FAILURE); -- 2.25.1