diff options
author | KaoruToda <kunnpuu@gmail.com> | 2017-10-17 23:04:09 +0900 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-10-18 16:05:06 +0100 |
commit | 26a7d938c9bf932a55cb5e4e02abb48fe395c5cd (patch) | |
tree | ce5b1908c181722514aa80d03026c6f42ab85972 /ssl | |
parent | 2139145b72d084a3f974a94accd7d9812de286e4 (diff) |
Remove parentheses of return.
Since return is inconsistent, I removed unnecessary parentheses and
unified them.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4541)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/bio_ssl.c | 34 | ||||
-rw-r--r-- | ssl/d1_lib.c | 2 | ||||
-rw-r--r-- | ssl/d1_msg.c | 2 | ||||
-rw-r--r-- | ssl/record/rec_layer_d1.c | 12 | ||||
-rw-r--r-- | ssl/record/rec_layer_s3.c | 4 | ||||
-rw-r--r-- | ssl/record/ssl3_record.c | 4 | ||||
-rw-r--r-- | ssl/s3_enc.c | 72 | ||||
-rw-r--r-- | ssl/s3_lib.c | 28 | ||||
-rw-r--r-- | ssl/s3_msg.c | 6 | ||||
-rw-r--r-- | ssl/ssl_cert.c | 4 | ||||
-rw-r--r-- | ssl/ssl_ciph.c | 2 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 214 | ||||
-rw-r--r-- | ssl/ssl_rsa.c | 70 | ||||
-rw-r--r-- | ssl/ssl_sess.c | 36 | ||||
-rw-r--r-- | ssl/ssl_txt.c | 8 | ||||
-rw-r--r-- | ssl/statem/statem_clnt.c | 2 | ||||
-rw-r--r-- | ssl/statem/statem_lib.c | 6 | ||||
-rw-r--r-- | ssl/t1_enc.c | 74 | ||||
-rw-r--r-- | ssl/tls_srp.c | 2 |
19 files changed, 291 insertions, 291 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index 6fdbdaca39..722d9420e3 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -49,7 +49,7 @@ static const BIO_METHOD methods_sslp = { const BIO_METHOD *BIO_f_ssl(void) { - return (&methods_sslp); + return &methods_sslp; } static int ssl_new(BIO *bi) @@ -58,7 +58,7 @@ static int ssl_new(BIO *bi) if (bs == NULL) { BIOerr(BIO_F_SSL_NEW, ERR_R_MALLOC_FAILURE); - return (0); + return 0; } BIO_set_init(bi, 0); BIO_set_data(bi, bs); @@ -73,7 +73,7 @@ static int ssl_free(BIO *a) BIO_SSL *bs; if (a == NULL) - return (0); + return 0; bs = BIO_get_data(a); if (bs->ssl != NULL) SSL_shutdown(bs->ssl); @@ -232,7 +232,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr) next = BIO_next(b); ssl = bs->ssl; if ((ssl == NULL) && (cmd != BIO_C_SET_SSL)) - return (0); + return 0; switch (cmd) { case BIO_CTRL_RESET: SSL_shutdown(ssl); @@ -394,7 +394,7 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr) ret = BIO_ctrl(ssl->rbio, cmd, num, ptr); break; } - return (ret); + return ret; } static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) @@ -419,7 +419,7 @@ static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) ret = BIO_callback_ctrl(ssl->rbio, cmd, fp); break; } - return (ret); + return ret; } static int ssl_puts(BIO *bp, const char *str) @@ -428,7 +428,7 @@ static int ssl_puts(BIO *bp, const char *str) n = strlen(str); ret = BIO_write(bp, str, n); - return (ret); + return ret; } BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx) @@ -437,17 +437,17 @@ BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx) BIO *ret = NULL, *buf = NULL, *ssl = NULL; if ((buf = BIO_new(BIO_f_buffer())) == NULL) - return (NULL); + return NULL; if ((ssl = BIO_new_ssl_connect(ctx)) == NULL) goto err; if ((ret = BIO_push(buf, ssl)) == NULL) goto err; - return (ret); + return ret; err: BIO_free(buf); BIO_free(ssl); #endif - return (NULL); + return NULL; } BIO *BIO_new_ssl_connect(SSL_CTX *ctx) @@ -456,16 +456,16 @@ BIO *BIO_new_ssl_connect(SSL_CTX *ctx) BIO *ret = NULL, *con = NULL, *ssl = NULL; if ((con = BIO_new(BIO_s_connect())) == NULL) - return (NULL); + return NULL; if ((ssl = BIO_new_ssl(ctx, 1)) == NULL) goto err; if ((ret = BIO_push(ssl, con)) == NULL) goto err; - return (ret); + return ret; err: BIO_free(con); #endif - return (NULL); + return NULL; } BIO *BIO_new_ssl(SSL_CTX *ctx, int client) @@ -474,10 +474,10 @@ BIO *BIO_new_ssl(SSL_CTX *ctx, int client) SSL *ssl; if ((ret = BIO_new(BIO_f_ssl())) == NULL) - return (NULL); + return NULL; if ((ssl = SSL_new(ctx)) == NULL) { BIO_free(ret); - return (NULL); + return NULL; } if (client) SSL_set_connect_state(ssl); @@ -485,7 +485,7 @@ BIO *BIO_new_ssl(SSL_CTX *ctx, int client) SSL_set_accept_state(ssl); BIO_set_ssl(ret, ssl, BIO_CLOSE); - return (ret); + return ret; } int BIO_ssl_copy_session_id(BIO *t, BIO *f) @@ -498,7 +498,7 @@ int BIO_ssl_copy_session_id(BIO *t, BIO *f) tdata = BIO_get_data(t); fdata = BIO_get_data(f); if ((tdata->ssl == NULL) || (fdata->ssl == NULL)) - return (0); + return 0; if (!SSL_copy_session_id(tdata->ssl, (fdata->ssl))) return 0; return 1; diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index a8ea097825..7f0fea57e9 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -236,7 +236,7 @@ long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg) ret = ssl3_ctrl(s, cmd, larg, parg); break; } - return (ret); + return ret; } void dtls1_start_timer(SSL *s) diff --git a/ssl/d1_msg.c b/ssl/d1_msg.c index 35a510d86f..5906e88ca6 100644 --- a/ssl/d1_msg.c +++ b/ssl/d1_msg.c @@ -17,7 +17,7 @@ int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf_, size_t len, if (SSL_in_init(s) && !ossl_statem_get_in_handshake(s)) { i = s->handshake_func(s); if (i < 0) - return (i); + return i; if (i == 0) { SSLerr(SSL_F_DTLS1_WRITE_APP_DATA_BYTES, SSL_R_SSL_HANDSHAKE_FAILURE); diff --git a/ssl/record/rec_layer_d1.c b/ssl/record/rec_layer_d1.c index 483d2a8f7e..59285ed591 100644 --- a/ssl/record/rec_layer_d1.c +++ b/ssl/record/rec_layer_d1.c @@ -21,7 +21,7 @@ int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl) DTLS_RECORD_LAYER *d; if ((d = OPENSSL_malloc(sizeof(*d))) == NULL) - return (0); + return 0; rl->d = d; @@ -36,7 +36,7 @@ int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl) pqueue_free(d->buffered_app_data.q); OPENSSL_free(d); rl->d = NULL; - return (0); + return 0; } return 1; @@ -179,7 +179,7 @@ int dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) OPENSSL_free(rdata->rbuf.buf); OPENSSL_free(rdata); pitem_free(item); - return (-1); + return -1; } /* insert should not fail, since duplicates are dropped */ @@ -188,7 +188,7 @@ int dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) OPENSSL_free(rdata->rbuf.buf); OPENSSL_free(rdata); pitem_free(item); - return (-1); + return -1; } return 1; @@ -208,7 +208,7 @@ int dtls1_retrieve_buffered_record(SSL *s, record_pqueue *queue) return 1; } - return (0); + return 0; } /* @@ -339,7 +339,7 @@ int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, if (!SSL3_BUFFER_is_initialised(&s->rlayer.rbuf)) { /* Not initialized yet */ if (!ssl3_setup_buffers(s)) - return (-1); + return -1; } if ((type && (type != SSL3_RT_APPLICATION_DATA) && diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index aec568707f..1225f9b4d8 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -657,7 +657,7 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, if (s->s3->alert_dispatch) { i = s->method->ssl_dispatch_alert(s); if (i <= 0) - return (i); + return i; /* if it went, fall through and send more stuff */ } @@ -1104,7 +1104,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, */ SSL3_BUFFER_set_left(&wb[currbuf], 0); } - return (i); + return i; } SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit); diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c index 518e7a8c3b..8d71cd3184 100644 --- a/ssl/record/ssl3_record.c +++ b/ssl/record/ssl3_record.c @@ -758,7 +758,7 @@ int ssl3_do_compress(SSL *ssl, SSL3_RECORD *wr) (int)(wr->length + SSL3_RT_MAX_COMPRESSED_OVERHEAD), wr->input, (int)wr->length); if (i < 0) - return (0); + return 0; else wr->length = i; @@ -1714,7 +1714,7 @@ int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap) f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: - return (0); + return 0; } /* diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index 7200766827..02e0598dc2 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -216,7 +216,7 @@ int ssl3_change_cipher_state(SSL *s, int which) err2: OPENSSL_cleanse(exp_key, sizeof(exp_key)); OPENSSL_cleanse(exp_iv, sizeof(exp_iv)); - return (0); + return 0; } int ssl3_setup_key_block(SSL *s) @@ -233,7 +233,7 @@ int ssl3_setup_key_block(SSL *s) if (!ssl_cipher_get_evp(s->session, &c, &hash, NULL, NULL, &comp, 0)) { SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); - return (0); + return 0; } s->s3->tmp.new_sym_enc = c; @@ -283,7 +283,7 @@ int ssl3_setup_key_block(SSL *s) err: SSLerr(SSL_F_SSL3_SETUP_KEY_BLOCK, ERR_R_MALLOC_FAILURE); - return (0); + return 0; } void ssl3_cleanup_key_block(SSL *s) @@ -471,72 +471,72 @@ int ssl3_alert_code(int code) { switch (code) { case SSL_AD_CLOSE_NOTIFY: - return (SSL3_AD_CLOSE_NOTIFY); + return SSL3_AD_CLOSE_NOTIFY; case SSL_AD_UNEXPECTED_MESSAGE: - return (SSL3_AD_UNEXPECTED_MESSAGE); + return SSL3_AD_UNEXPECTED_MESSAGE; case SSL_AD_BAD_RECORD_MAC: - return (SSL3_AD_BAD_RECORD_MAC); + return SSL3_AD_BAD_RECORD_MAC; case SSL_AD_DECRYPTION_FAILED: - return (SSL3_AD_BAD_RECORD_MAC); + return SSL3_AD_BAD_RECORD_MAC; case SSL_AD_RECORD_OVERFLOW: - return (SSL3_AD_BAD_RECORD_MAC); + return SSL3_AD_BAD_RECORD_MAC; case SSL_AD_DECOMPRESSION_FAILURE: - return (SSL3_AD_DECOMPRESSION_FAILURE); + return SSL3_AD_DECOMPRESSION_FAILURE; case SSL_AD_HANDSHAKE_FAILURE: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_NO_CERTIFICATE: - return (SSL3_AD_NO_CERTIFICATE); + return SSL3_AD_NO_CERTIFICATE; case SSL_AD_BAD_CERTIFICATE: - return (SSL3_AD_BAD_CERTIFICATE); + return SSL3_AD_BAD_CERTIFICATE; case SSL_AD_UNSUPPORTED_CERTIFICATE: - return (SSL3_AD_UNSUPPORTED_CERTIFICATE); + return SSL3_AD_UNSUPPORTED_CERTIFICATE; case SSL_AD_CERTIFICATE_REVOKED: - return (SSL3_AD_CERTIFICATE_REVOKED); + return SSL3_AD_CERTIFICATE_REVOKED; case SSL_AD_CERTIFICATE_EXPIRED: - return (SSL3_AD_CERTIFICATE_EXPIRED); + return SSL3_AD_CERTIFICATE_EXPIRED; case SSL_AD_CERTIFICATE_UNKNOWN: - return (SSL3_AD_CERTIFICATE_UNKNOWN); + return SSL3_AD_CERTIFICATE_UNKNOWN; case SSL_AD_ILLEGAL_PARAMETER: - return (SSL3_AD_ILLEGAL_PARAMETER); + return SSL3_AD_ILLEGAL_PARAMETER; case SSL_AD_UNKNOWN_CA: - return (SSL3_AD_BAD_CERTIFICATE); + return SSL3_AD_BAD_CERTIFICATE; case SSL_AD_ACCESS_DENIED: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_DECODE_ERROR: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_DECRYPT_ERROR: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_EXPORT_RESTRICTION: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_PROTOCOL_VERSION: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_INSUFFICIENT_SECURITY: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_INTERNAL_ERROR: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_USER_CANCELLED: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_NO_RENEGOTIATION: - return (-1); /* Don't send it :-) */ + return -1; /* Don't send it :-) */ case SSL_AD_UNSUPPORTED_EXTENSION: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_CERTIFICATE_UNOBTAINABLE: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_UNRECOGNIZED_NAME: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_BAD_CERTIFICATE_HASH_VALUE: - return (SSL3_AD_HANDSHAKE_FAILURE); + return SSL3_AD_HANDSHAKE_FAILURE; case SSL_AD_UNKNOWN_PSK_IDENTITY: - return (TLS1_AD_UNKNOWN_PSK_IDENTITY); + return TLS1_AD_UNKNOWN_PSK_IDENTITY; case SSL_AD_INAPPROPRIATE_FALLBACK: - return (TLS1_AD_INAPPROPRIATE_FALLBACK); + return TLS1_AD_INAPPROPRIATE_FALLBACK; case SSL_AD_NO_APPLICATION_PROTOCOL: - return (TLS1_AD_NO_APPLICATION_PROTOCOL); + return TLS1_AD_NO_APPLICATION_PROTOCOL; case SSL_AD_CERTIFICATE_REQUIRED: return SSL_AD_HANDSHAKE_FAILURE; default: - return (-1); + return -1; } } diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index f603f1c1a3..f4423b2855 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3276,15 +3276,15 @@ long ssl3_default_timeout(void) int ssl3_num_ciphers(void) { - return (SSL3_NUM_CIPHERS); + return SSL3_NUM_CIPHERS; } const SSL_CIPHER *ssl3_get_cipher(unsigned int u) { if (u < SSL3_NUM_CIPHERS) - return (&(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u])); + return &(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]); else - return (NULL); + return NULL; } int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype) @@ -3429,7 +3429,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) EVP_PKEY *pkdh = NULL; if (dh == NULL) { SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER); - return (ret); + return ret; } pkdh = ssl_dh_to_pkey(dh); if (pkdh == NULL) { @@ -3450,7 +3450,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) case SSL_CTRL_SET_TMP_DH_CB: { SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return (ret); + return ret; } case SSL_CTRL_SET_DH_AUTO: s->cert->dh_tmp_auto = larg; @@ -3715,7 +3715,7 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) default: break; } - return (ret); + return ret; } long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void)) @@ -3743,7 +3743,7 @@ long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void)) default: break; } - return (ret); + return ret; } long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) @@ -3776,7 +3776,7 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) case SSL_CTRL_SET_TMP_DH_CB: { SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return (0); + return 0; } case SSL_CTRL_SET_DH_AUTO: ctx->cert->dh_tmp_auto = larg; @@ -3984,7 +3984,7 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) return ssl_cert_set_current(ctx->cert, larg); default: - return (0); + return 0; } return 1; } @@ -4036,7 +4036,7 @@ long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void)) } break; default: - return (0); + return 0; } return 1; } @@ -4229,7 +4229,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, break; } } - return (ret); + return ret; } int ssl3_get_req_cert_type(SSL *s, WPACKET *pkt) @@ -4321,7 +4321,7 @@ int ssl3_shutdown(SSL *s) * written, s->s3->alert_dispatch will be true */ if (s->s3->alert_dispatch) - return (-1); /* return WANT_WRITE */ + return -1; /* return WANT_WRITE */ } else if (s->s3->alert_dispatch) { /* resend it if not sent */ ret = s->method->ssl_dispatch_alert(s); @@ -4331,7 +4331,7 @@ int ssl3_shutdown(SSL *s) * have already signalled return 0 upon a previous invocation, * return WANT_WRITE */ - return (ret); + return ret; } } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) { size_t readbytes; @@ -4348,7 +4348,7 @@ int ssl3_shutdown(SSL *s) !s->s3->alert_dispatch) return 1; else - return (0); + return 0; } int ssl3_write(SSL *s, const void *buf, size_t len, size_t *written) diff --git a/ssl/s3_msg.c b/ssl/s3_msg.c index afdac4ee32..5e6e7c4428 100644 --- a/ssl/s3_msg.c +++ b/ssl/s3_msg.c @@ -25,16 +25,16 @@ int ssl3_do_change_cipher_spec(SSL *s) if (s->session == NULL || s->session->master_key_length == 0) { /* might happen if dtls1_read_bytes() calls this */ SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC, SSL_R_CCS_RECEIVED_EARLY); - return (0); + return 0; } s->session->cipher = s->s3->tmp.new_cipher; if (!s->method->ssl3_enc->setup_key_block(s)) - return (0); + return 0; } if (!s->method->ssl3_enc->change_cipher_state(s, i)) - return (0); + return 0; /* * we have to record the message digest at this point so we can get it diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 9a1d936bb4..3de3c2c7c5 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -572,7 +572,7 @@ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x) static int xname_sk_cmp(const X509_NAME *const *a, const X509_NAME *const *b) { - return (X509_NAME_cmp(*a, *b)); + return X509_NAME_cmp(*a, *b); } static int xname_cmp(const X509_NAME *a, const X509_NAME *b) @@ -647,7 +647,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) lh_X509_NAME_free(name_hash); if (ret != NULL) ERR_clear_error(); - return (ret); + return ret; } /** diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index c04dd04976..59b08517bf 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1776,7 +1776,7 @@ SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n) int i, nn; if ((n == 0) || (sk == NULL)) - return (NULL); + return NULL; nn = sk_SSL_COMP_num(sk); for (i = 0; i < nn; i++) { ctmp = sk_SSL_COMP_value(sk, i); diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index ce45a91613..cefb0ba5f2 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -602,7 +602,7 @@ int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth) SSL_DEFAULT_CIPHER_LIST, ctx->cert); if ((sk == NULL) || (sk_SSL_CIPHER_num(sk) <= 0)) { SSLerr(SSL_F_SSL_CTX_SET_SSL_VERSION, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS); - return (0); + return 0; } return 1; } @@ -613,11 +613,11 @@ SSL *SSL_new(SSL_CTX *ctx) if (ctx == NULL) { SSLerr(SSL_F_SSL_NEW, SSL_R_NULL_SSL_CTX); - return (NULL); + return NULL; } if (ctx->method == NULL) { SSLerr(SSL_F_SSL_NEW, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION); - return (NULL); + return NULL; } s = OPENSSL_zalloc(sizeof(*s)); @@ -1251,7 +1251,7 @@ int SSL_get_rfd(const SSL *s) r = BIO_find_type(b, BIO_TYPE_DESCRIPTOR); if (r != NULL) BIO_get_fd(r, &ret); - return (ret); + return ret; } int SSL_get_wfd(const SSL *s) @@ -1263,7 +1263,7 @@ int SSL_get_wfd(const SSL *s) r = BIO_find_type(b, BIO_TYPE_DESCRIPTOR); if (r != NULL) BIO_get_fd(r, &ret); - return (ret); + return ret; } #ifndef OPENSSL_NO_SOCK @@ -1282,7 +1282,7 @@ int SSL_set_fd(SSL *s, int fd) SSL_set_bio(s, bio, bio); ret = 1; err: - return (ret); + return ret; } int SSL_set_wfd(SSL *s, int fd) @@ -1359,7 +1359,7 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count) int SSL_get_verify_mode(const SSL *s) { - return (s->verify_mode); + return s->verify_mode; } int SSL_get_verify_depth(const SSL *s) @@ -1368,12 +1368,12 @@ int SSL_get_verify_depth(const SSL *s) } int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *) { - return (s->verify_callback); + return s->verify_callback; } int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) { - return (ctx->verify_mode); + return ctx->verify_mode; } int SSL_CTX_get_verify_depth(const SSL_CTX *ctx) @@ -1382,7 +1382,7 @@ int SSL_CTX_get_verify_depth(const SSL_CTX *ctx) } int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, X509_STORE_CTX *) { - return (ctx->default_verify_callback); + return ctx->default_verify_callback; } void SSL_set_verify(SSL *s, int mode, @@ -1451,11 +1451,11 @@ X509 *SSL_get_peer_certificate(const SSL *s) r = s->session->peer; if (r == NULL) - return (r); + return r; X509_up_ref(r); - return (r); + return r; } STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s) @@ -1472,7 +1472,7 @@ STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s) * we are a server, it does not. */ - return (r); + return r; } /* @@ -1512,14 +1512,14 @@ int SSL_CTX_check_private_key(const SSL_CTX *ctx) { if ((ctx == NULL) || (ctx->cert->key->x509 == NULL)) { SSLerr(SSL_F_SSL_CTX_CHECK_PRIVATE_KEY, SSL_R_NO_CERTIFICATE_ASSIGNED); - return (0); + return 0; } if (ctx->cert->key->privatekey == NULL) { SSLerr(SSL_F_SSL_CTX_CHECK_PRIVATE_KEY, SSL_R_NO_PRIVATE_KEY_ASSIGNED); - return (0); + return 0; } - return (X509_check_private_key - (ctx->cert->key->x509, ctx->cert->key->privatekey)); + return X509_check_private_key + (ctx->cert->key->x509, ctx->cert->key->privatekey); } /* Fix this function so that it takes an optional type parameter */ @@ -1527,18 +1527,18 @@ int SSL_check_private_key(const SSL *ssl) { if (ssl == NULL) { SSLerr(SSL_F_SSL_CHECK_PRIVATE_KEY, ERR_R_PASSED_NULL_PARAMETER); - return (0); + return 0; } if (ssl->cert->key->x509 == NULL) { SSLerr(SSL_F_SSL_CHECK_PRIVATE_KEY, SSL_R_NO_CERTIFICATE_ASSIGNED); - return (0); + return 0; } if (ssl->cert->key->privatekey == NULL) { SSLerr(SSL_F_SSL_CHECK_PRIVATE_KEY, SSL_R_NO_PRIVATE_KEY_ASSIGNED); - return (0); + return 0; } - return (X509_check_private_key(ssl->cert->key->x509, - ssl->cert->key->privatekey)); + return X509_check_private_key(ssl->cert->key->x509, + ssl->cert->key->privatekey); } int SSL_waiting_for_async(SSL *s) @@ -1591,7 +1591,7 @@ int SSL_connect(SSL *s) long SSL_get_default_timeout(const SSL *s) { - return (s->method->get_timeout()); + return s->method->get_timeout(); } static int ssl_start_async_job(SSL *s, struct ssl_async_args *args, @@ -2038,7 +2038,7 @@ int SSL_renegotiate(SSL *s) s->renegotiate = 1; s->new_session = 1; - return (s->method->ssl_renegotiate(s)); + return s->method->ssl_renegotiate(s); } int SSL_renegotiate_abbreviated(SSL *s) @@ -2056,7 +2056,7 @@ int SSL_renegotiate_abbreviated(SSL *s) s->renegotiate = 1; s->new_session = 0; - return (s->method->ssl_renegotiate(s)); + return s->method->ssl_renegotiate(s); } int SSL_renegotiate_pending(SSL *s) @@ -2074,11 +2074,11 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg) switch (cmd) { case SSL_CTRL_GET_READ_AHEAD: - return (RECORD_LAYER_get_read_ahead(&s->rlayer)); + return RECORD_LAYER_get_read_ahead(&s->rlayer); case SSL_CTRL_SET_READ_AHEAD: l = RECORD_LAYER_get_read_ahead(&s->rlayer); RECORD_LAYER_set_read_ahead(&s->rlayer, larg); - return (l); + return l; case SSL_CTRL_SET_MSG_CALLBACK_ARG: s->msg_callback_arg = parg; @@ -2089,7 +2089,7 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg) case SSL_CTRL_CLEAR_MODE: return (s->mode &= ~larg); case SSL_CTRL_GET_MAX_CERT_LIST: - return (long)(s->max_cert_list); + return (long)s->max_cert_list; case SSL_CTRL_SET_MAX_CERT_LIST: if (larg < 0) return 0; @@ -2154,7 +2154,7 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg) case SSL_CTRL_GET_MAX_PROTO_VERSION: return s->max_proto_version; default: - return (s->method->ssl_ctrl(s, cmd, larg, parg)); + return s->method->ssl_ctrl(s, cmd, larg, parg); } } @@ -2169,7 +2169,7 @@ long SSL_callback_ctrl(SSL *s, int cmd, void (*fp) (void)) return 1; default: - return (s->method->ssl_callback_ctrl(s, cmd, fp)); + return s->method->ssl_callback_ctrl(s, cmd, fp); } } @@ -2198,18 +2198,18 @@ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) switch (cmd) { case SSL_CTRL_GET_READ_AHEAD: - return (ctx->read_ahead); + return ctx->read_ahead; case SSL_CTRL_SET_READ_AHEAD: l = ctx->read_ahead; ctx->read_ahead = larg; - return (l); + return l; case SSL_CTRL_SET_MSG_CALLBACK_ARG: ctx->msg_callback_arg = parg; return 1; case SSL_CTRL_GET_MAX_CERT_LIST: - return (long)(ctx->max_cert_list); + return (long)ctx->max_cert_list; case SSL_CTRL_SET_MAX_CERT_LIST: if (larg < 0) return 0; @@ -2224,38 +2224,38 @@ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) ctx->session_cache_size = (size_t)larg; return l; case SSL_CTRL_GET_SESS_CACHE_SIZE: - return (long)(ctx->session_cache_size); + return (long)ctx->session_cache_size; case SSL_CTRL_SET_SESS_CACHE_MODE: l = ctx->session_cache_mode; ctx->session_cache_mode = larg; - return (l); + return l; case SSL_CTRL_GET_SESS_CACHE_MODE: - return (ctx->session_cache_mode); + return ctx->session_cache_mode; case SSL_CTRL_SESS_NUMBER: - return (lh_SSL_SESSION_num_items(ctx->sessions)); + return lh_SSL_SESSION_num_items(ctx->sessions); case SSL_CTRL_SESS_CONNECT: - return (ctx->stats.sess_connect); + return ctx->stats.sess_connect; case SSL_CTRL_SESS_CONNECT_GOOD: - return (ctx->stats.sess_connect_good); + return ctx->stats.sess_connect_good; case SSL_CTRL_SESS_CONNECT_RENEGOTIATE: - return (ctx->stats.sess_connect_renegotiate); + return ctx->stats.sess_connect_renegotiate; case SSL_CTRL_SESS_ACCEPT: - return (ctx->stats.sess_accept); + return ctx->stats.sess_accept; case SSL_CTRL_SESS_ACCEPT_GOOD: - return (ctx->stats.sess_accept_good); + return ctx->stats.sess_accept_good; case SSL_CTRL_SESS_ACCEPT_RENEGOTIATE: - return (ctx->stats.sess_accept_renegotiate); + return ctx->stats.sess_accept_renegotiate; case SSL_CTRL_SESS_HIT: - return (ctx->stats.sess_hit); + return ctx->stats.sess_hit; case SSL_CTRL_SESS_CB_HIT: - return (ctx->stats.sess_cb_hit); + return ctx->stats.sess_cb_hit; case SSL_CTRL_SESS_MISSES: - return (ctx->stats.sess_miss); + return ctx->stats.sess_miss; case SSL_CTRL_SESS_TIMEOUTS: - return (ctx->stats.sess_timeout); + return ctx->stats.sess_timeout; case SSL_CTRL_SESS_CACHE_FULL: - return ( |