summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-07-22 15:04:07 +0100
committerMatt Caswell <matt@openssl.org>2022-08-18 16:38:13 +0100
commitd4ee3456e98b1137a1ba013cf01f1052891dd3db (patch)
tree0d8ab41c204ac4aed96cc8656db6db1a7c812b2c /ssl
parent3de7695928478bce22dcf6bf87883688d895dc43 (diff)
Correct some formatting errors in tls1_meth.c
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18132)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/record/methods/tls1_meth.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/ssl/record/methods/tls1_meth.c b/ssl/record/methods/tls1_meth.c
index 698ebdc008..ae162e69a4 100644
--- a/ssl/record/methods/tls1_meth.c
+++ b/ssl/record/methods/tls1_meth.c
@@ -148,7 +148,6 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
return 0;
}
-
if (EVP_MD_CTX_get0_md(rl->md_ctx)) {
int n = EVP_MD_CTX_get_size(rl->md_ctx);
if (!ossl_assert(n >= 0)) {
@@ -176,10 +175,6 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
if (ivlen > 1) {
for (ctr = 0; ctr < n_recs; ctr++) {
if (recs[ctr].data != recs[ctr].input) {
- /*
- * we can't write into the input stream: Can this ever
- * happen?? (steve)
- */
RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
return 0;
} else if (RAND_bytes_ex(rl->libctx, recs[ctr].input,
@@ -203,9 +198,9 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ds))
& EVP_CIPH_FLAG_PIPELINE) == 0) {
/*
- * We shouldn't have been called with pipeline data if the
- * cipher doesn't support pipelining
- */
+ * We shouldn't have been called with pipeline data if the
+ * cipher doesn't support pipelining
+ */
RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_PIPELINE_FAILURE);
return 0;
}
@@ -253,9 +248,9 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
} else if ((bs != 1) && sending && !provided) {
/*
- * We only do this for legacy ciphers. Provided ciphers add the
- * padding on the provider side.
- */
+ * We only do this for legacy ciphers. Provided ciphers add the
+ * padding on the provider side.
+ */
padnum = bs - (reclen[ctr] % bs);
/* Add weird padding of up to 256 bytes */
@@ -309,10 +304,10 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
int decrement_seq = 0;
/*
- * When sending, seq is incremented after MAC calculation.
- * So if we are in ETM mode, we use seq 'as is' in the ctrl-function.
- * Otherwise we have to decrease it in the implementation
- */
+ * When sending, seq is incremented after MAC calculation.
+ * So if we are in ETM mode, we use seq 'as is' in the ctrl-function.
+ * Otherwise we have to decrease it in the implementation
+ */
if (sending && !rl->use_etm)
decrement_seq = 1;
@@ -338,10 +333,10 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
recs[0].length = outlen;
/*
- * The length returned from EVP_CipherUpdate above is the actual
- * payload length. We need to adjust the data/input ptr to skip over
- * any explicit IV
- */
+ * The length returned from EVP_CipherUpdate above is the actual
+ * payload length. We need to adjust the data/input ptr to skip over
+ * any explicit IV
+ */
if (!sending) {
if (EVP_CIPHER_get_mode(enc) == EVP_CIPH_GCM_MODE) {
recs[0].data += EVP_GCM_TLS_EXPLICIT_IV_LEN;
@@ -409,9 +404,9 @@ static int tls1_cipher(OSSL_RECORD_LAYER *rl, SSL3_RECORD *recs, size_t n_recs,
}
/*
- * If using Mac-then-encrypt, then this will succeed but
- * with a random MAC if padding is invalid
- */
+ * If using Mac-then-encrypt, then this will succeed but
+ * with a random MAC if padding is invalid
+ */
if (!tls1_cbc_remove_padding_and_mac(&recs[ctr].length,
recs[ctr].orig_len,
recs[ctr].data,