diff options
author | Todd Short <tshort@akamai.com> | 2017-04-13 10:20:04 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-04-19 12:51:08 -0400 |
commit | d1186c30a265aedecb1b497c220b4cb7c2a7f4ec (patch) | |
tree | 249eec318ace925cd3311685e348053d667a7c8e /ssl | |
parent | 87b81496fec2f969371b3167dea3b6aaed9f9f9d (diff) | |
download | openssl-d1186c30a265aedecb1b497c220b4cb7c2a7f4ec.tar.gz |
Fix minor compiler issues.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3220)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/record/ssl3_record_tls13.c | 14 | ||||
-rw-r--r-- | ssl/statem/extensions_srvr.c | 2 | ||||
-rw-r--r-- | ssl/statem/statem.c | 12 | ||||
-rw-r--r-- | ssl/tls13_enc.c | 14 |
4 files changed, 21 insertions, 21 deletions
diff --git a/ssl/record/ssl3_record_tls13.c b/ssl/record/ssl3_record_tls13.c index c6ea511b4d..9e65852f9d 100644 --- a/ssl/record/ssl3_record_tls13.c +++ b/ssl/record/ssl3_record_tls13.c @@ -21,7 +21,7 @@ * -1: if the record's AEAD-authenticator is invalid or, if sending, * an internal error occurred. */ -int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) +int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int sending) { EVP_CIPHER_CTX *ctx; unsigned char iv[EVP_MAX_IV_LENGTH]; @@ -38,7 +38,7 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) return -1; } - if (send) { + if (sending) { ctx = s->enc_write_ctx; staticiv = s->write_iv; seq = RECORD_LAYER_get_write_sequence(&s->rlayer); @@ -75,7 +75,7 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) taglen = EVP_CCM8_TLS_TAG_LEN; else taglen = EVP_CCM_TLS_TAG_LEN; - if (send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, taglen, + if (sending && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, taglen, NULL) <= 0) return -1; } else if (alg_enc & SSL_AESGCM) { @@ -86,7 +86,7 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) return -1; } - if (!send) { + if (!sending) { /* * Take off tag. There must be at least one byte of content type as * well as the tag @@ -118,8 +118,8 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) } /* TODO(size_t): lenu/lenf should be a size_t but EVP doesn't support it */ - if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, send) <= 0 - || (!send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, + if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, sending) <= 0 + || (!sending && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, taglen, rec->data + rec->length) <= 0) || EVP_CipherUpdate(ctx, rec->data, &lenu, rec->input, @@ -128,7 +128,7 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send) || (size_t)(lenu + lenf) != rec->length) { return -1; } - if (send) { + if (sending) { /* Add the tag */ if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, taglen, rec->data + rec->length) <= 0) diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index da7e8c8aa0..7ba1aac8d4 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -780,7 +780,7 @@ int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, * client's due to the network latency). Therefore we add 1000ms to our age * calculation to adjust for rounding errors. */ - if (sess->timeout >= agesec + if (sess->timeout >= (long)agesec && agems / (uint32_t)1000 == agesec && ticket_age <= agems + 1000 && ticket_age + TICKET_AGE_ALLOWANCE >= agems + 1000) { diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c index 92a0e8f1ec..e63d0ada0b 100644 --- a/ssl/statem/statem.c +++ b/ssl/statem/statem.c @@ -172,13 +172,13 @@ int ossl_statem_skip_early_data(SSL *s) * Called when we are in SSL_read*(), SSL_write*(), or SSL_accept() * /SSL_connect()/SSL_do_handshake(). Used to test whether we are in an early * data state and whether we should attempt to move the handshake on if so. - * |send| is 1 if we are attempting to send data (SSL_write*()), 0 if we are + * |sending| is 1 if we are attempting to send data (SSL_write*()), 0 if we are * attempting to read data (SSL_read*()), or -1 if we are in SSL_do_handshake() * or similar. */ -void ossl_statem_check_finish_init(SSL *s, int send) +void ossl_statem_check_finish_init(SSL *s, int sending) { - if (send == -1) { + if (sending == -1) { if (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END || s->statem.hand_state == TLS_ST_EARLY_DATA) { ossl_statem_set_in_init(s, 1); @@ -191,16 +191,16 @@ void ossl_statem_check_finish_init(SSL *s, int send) } } } else if (!s->server) { - if ((send && (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END + if ((sending && (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END || s->statem.hand_state == TLS_ST_EARLY_DATA) && s->early_data_state != SSL_EARLY_DATA_WRITING) - || (!send && s->statem.hand_state == TLS_ST_EARLY_DATA)) { + || (!sending && s->statem.hand_state == TLS_ST_EARLY_DATA)) { ossl_statem_set_in_init(s, 1); /* * SSL_write() has been called directly. We don't allow any more * writing of early data. */ - if (send && s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY) + if (sending && s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY) s->early_data_state = SSL_EARLY_DATA_FINISHED_WRITING; } } else { diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c index 2ae4552843..9030d1a292 100644 --- a/ssl/tls13_enc.c +++ b/ssl/tls13_enc.c @@ -267,7 +267,7 @@ int tls13_setup_key_block(SSL *s) return 1; } -static int derive_secret_key_and_iv(SSL *s, int send, const EVP_MD *md, +static int derive_secret_key_and_iv(SSL *s, int sending, const EVP_MD *md, const EVP_CIPHER *ciph, const unsigned char *insecret, const unsigned char *hash, @@ -312,7 +312,7 @@ static int derive_secret_key_and_iv(SSL *s, int send, const EVP_MD *md, goto err; } - if (EVP_CipherInit_ex(ciph_ctx, ciph, NULL, NULL, NULL, send) <= 0 + if (EVP_CipherInit_ex(ciph_ctx, ciph, NULL, NULL, NULL, sending) <= 0 || !EVP_CIPHER_CTX_ctrl(ciph_ctx, EVP_CTRL_AEAD_SET_IVLEN, ivlen, NULL) || (taglen != 0 && !EVP_CIPHER_CTX_ctrl(ciph_ctx, EVP_CTRL_AEAD_SET_TAG, taglen, NULL)) @@ -323,7 +323,7 @@ static int derive_secret_key_and_iv(SSL *s, int send, const EVP_MD *md, #ifdef OPENSSL_SSL_TRACE_CRYPTO if (s->msg_callback) { - int wh = send ? TLS1_RT_CRYPTO_WRITE : 0; + int wh = sending ? TLS1_RT_CRYPTO_WRITE : 0; if (ciph->key_len) s->msg_callback(2, s->version, wh | TLS1_RT_CRYPTO_KEY, @@ -557,7 +557,7 @@ int tls13_change_cipher_state(SSL *s, int which) return ret; } -int tls13_update_key(SSL *s, int send) +int tls13_update_key(SSL *s, int sending) { static const unsigned char application_traffic[] = "application traffic secret"; @@ -568,12 +568,12 @@ int tls13_update_key(SSL *s, int send) EVP_CIPHER_CTX *ciph_ctx; int ret = 0; - if (s->server == send) + if (s->server == sending) insecret = s->server_app_traffic_secret; else insecret = s->client_app_traffic_secret; - if (send) { + if (sending) { iv = s->write_iv; ciph_ctx = s->enc_write_ctx; RECORD_LAYER_reset_write_sequence(&s->rlayer); @@ -583,7 +583,7 @@ int tls13_update_key(SSL *s, int send) RECORD_LAYER_reset_read_sequence(&s->rlayer); } - if (!derive_secret_key_and_iv(s, send, ssl_handshake_md(s), + if (!derive_secret_key_and_iv(s, sending, ssl_handshake_md(s), s->s3->tmp.new_sym_enc, insecret, NULL, application_traffic, sizeof(application_traffic) - 1, secret, iv, |