From d8cbd9f61b4f17e66988182d3ab66022b1acf6df Mon Sep 17 00:00:00 2001 From: miod <> Date: Tue, 27 May 2014 18:51:24 +0000 Subject: Remove redundant test introduced in s3_pkt.c on 20001225, which got cargo-culted (with an XXX comment, though) in d1_pkt.c in 2005. --- src/lib/libssl/d1_pkt.c | 5 ++--- src/lib/libssl/s3_pkt.c | 4 ++-- src/lib/libssl/src/ssl/d1_pkt.c | 5 ++--- src/lib/libssl/src/ssl/s3_pkt.c | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 4e306829bc..c855d0e2a6 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c @@ -731,9 +731,8 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) if (!ssl3_setup_buffers(s)) return (-1); - /* XXX: check what the second '&& type' is about */ - if ((type && (type != SSL3_RT_APPLICATION_DATA) && - (type != SSL3_RT_HANDSHAKE) && type) || + if ((type && + type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_HANDSHAKE) || (peek && (type != SSL3_RT_APPLICATION_DATA))) { SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); return -1; diff --git a/src/lib/libssl/s3_pkt.c b/src/lib/libssl/s3_pkt.c index da6c860cfc..3a167f058c 100644 --- a/src/lib/libssl/s3_pkt.c +++ b/src/lib/libssl/s3_pkt.c @@ -907,8 +907,8 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) return -1; } - if ((type && (type != SSL3_RT_APPLICATION_DATA) && - (type != SSL3_RT_HANDSHAKE) && type) || + if ((type && + type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_HANDSHAKE) || (peek && (type != SSL3_RT_APPLICATION_DATA))) { SSLerr(SSL_F_SSL3_READ_BYTES, ERR_R_INTERNAL_ERROR); return -1; diff --git a/src/lib/libssl/src/ssl/d1_pkt.c b/src/lib/libssl/src/ssl/d1_pkt.c index 4e306829bc..c855d0e2a6 100644 --- a/src/lib/libssl/src/ssl/d1_pkt.c +++ b/src/lib/libssl/src/ssl/d1_pkt.c @@ -731,9 +731,8 @@ dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) if (!ssl3_setup_buffers(s)) return (-1); - /* XXX: check what the second '&& type' is about */ - if ((type && (type != SSL3_RT_APPLICATION_DATA) && - (type != SSL3_RT_HANDSHAKE) && type) || + if ((type && + type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_HANDSHAKE) || (peek && (type != SSL3_RT_APPLICATION_DATA))) { SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); return -1; diff --git a/src/lib/libssl/src/ssl/s3_pkt.c b/src/lib/libssl/src/ssl/s3_pkt.c index da6c860cfc..3a167f058c 100644 --- a/src/lib/libssl/src/ssl/s3_pkt.c +++ b/src/lib/libssl/src/ssl/s3_pkt.c @@ -907,8 +907,8 @@ ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) return -1; } - if ((type && (type != SSL3_RT_APPLICATION_DATA) && - (type != SSL3_RT_HANDSHAKE) && type) || + if ((type && + type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_HANDSHAKE) || (peek && (type != SSL3_RT_APPLICATION_DATA))) { SSLerr(SSL_F_SSL3_READ_BYTES, ERR_R_INTERNAL_ERROR); return -1; -- cgit v1.2.3-55-g6feb