提交 8dd94afb 编写于 作者: R Rich Salz

Live code cleanup; #if 1 removal

A few minor cleanups to remove pre-processor "#if 1" stuff.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 7e35f06e
...@@ -4518,9 +4518,7 @@ int ssl3_shutdown(SSL *s) ...@@ -4518,9 +4518,7 @@ int ssl3_shutdown(SSL *s)
if (!(s->shutdown & SSL_SENT_SHUTDOWN)) { if (!(s->shutdown & SSL_SENT_SHUTDOWN)) {
s->shutdown |= SSL_SENT_SHUTDOWN; s->shutdown |= SSL_SENT_SHUTDOWN;
#if 1
ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY); ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY);
#endif
/* /*
* our shutdown alert has been sent now, and if it still needs to be * our shutdown alert has been sent now, and if it still needs to be
* written, s->s3->alert_dispatch will be true * written, s->s3->alert_dispatch will be true
...@@ -4529,7 +4527,6 @@ int ssl3_shutdown(SSL *s) ...@@ -4529,7 +4527,6 @@ int ssl3_shutdown(SSL *s)
return (-1); /* return WANT_WRITE */ return (-1); /* return WANT_WRITE */
} else if (s->s3->alert_dispatch) { } else if (s->s3->alert_dispatch) {
/* resend it if not sent */ /* resend it if not sent */
#if 1
ret = s->method->ssl_dispatch_alert(s); ret = s->method->ssl_dispatch_alert(s);
if (ret == -1) { if (ret == -1) {
/* /*
...@@ -4539,7 +4536,6 @@ int ssl3_shutdown(SSL *s) ...@@ -4539,7 +4536,6 @@ int ssl3_shutdown(SSL *s)
*/ */
return (ret); return (ret);
} }
#endif
} else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) { } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
/* /*
* If we are waiting for a close from our peer, we are closed * If we are waiting for a close from our peer, we are closed
......
...@@ -906,11 +906,7 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, ...@@ -906,11 +906,7 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
if ((sess == NULL) || if ((sess == NULL) ||
(s->enc_write_ctx == NULL) || (s->enc_write_ctx == NULL) ||
(EVP_MD_CTX_md(s->write_hash) == NULL)) { (EVP_MD_CTX_md(s->write_hash) == NULL)) {
#if 1
clear = s->enc_write_ctx ? 0 : 1; /* must be AEAD cipher */ clear = s->enc_write_ctx ? 0 : 1; /* must be AEAD cipher */
#else
clear = 1;
#endif
mac_size = 0; mac_size = 0;
} else { } else {
mac_size = EVP_MD_CTX_size(s->write_hash); mac_size = EVP_MD_CTX_size(s->write_hash);
......
...@@ -739,11 +739,7 @@ int ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk) ...@@ -739,11 +739,7 @@ int ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk)
X509_STORE_CTX_set_verify_cb(&ctx, s->verify_callback); X509_STORE_CTX_set_verify_cb(&ctx, s->verify_callback);
if (s->ctx->app_verify_callback != NULL) if (s->ctx->app_verify_callback != NULL)
#if 1 /* new with OpenSSL 0.9.7 */
i = s->ctx->app_verify_callback(&ctx, s->ctx->app_verify_arg); i = s->ctx->app_verify_callback(&ctx, s->ctx->app_verify_arg);
#else
i = s->ctx->app_verify_callback(&ctx); /* should pass app_verify_arg */
#endif
else { else {
i = X509_verify_cert(&ctx); i = X509_verify_cert(&ctx);
# if 0 # if 0
......
...@@ -245,7 +245,6 @@ int SSL_clear(SSL *s) ...@@ -245,7 +245,6 @@ int SSL_clear(SSL *s)
s->first_packet = 0; s->first_packet = 0;
#if 1
/* /*
* Check to see if we were changed into a different method, if so, revert * Check to see if we were changed into a different method, if so, revert
* back if we are not doing session-id reuse. * back if we are not doing session-id reuse.
...@@ -257,7 +256,6 @@ int SSL_clear(SSL *s) ...@@ -257,7 +256,6 @@ int SSL_clear(SSL *s)
if (!s->method->ssl_new(s)) if (!s->method->ssl_new(s))
return (0); return (0);
} else } else
#endif
s->method->ssl_clear(s); s->method->ssl_clear(s);
return (1); return (1);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册