aboutsummaryrefslogtreecommitdiff
path: root/ssl/statem/statem.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssl/statem/statem.c')
-rw-r--r--ssl/statem/statem.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 3342cb06d208..00631bf55e0e 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2015-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2026 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -151,7 +151,7 @@ void ossl_statem_send_fatal(SSL_CONNECTION *s, int al)
return;
ossl_statem_set_in_init(s, 1);
s->statem.state = MSG_FLOW_ERROR;
- if (al != SSL_AD_NO_ALERT)
+ if (al != SSL_AD_NO_ALERT && s->rlayer.wrlmethod != NULL)
ssl3_send_alert(s, SSL3_AL_FATAL, al);
}
@@ -541,22 +541,6 @@ static void init_read_state_machine(SSL_CONNECTION *s)
st->read_state = READ_STATE_HEADER;
}
-static int grow_init_buf(SSL_CONNECTION *s, size_t size)
-{
-
- size_t msg_offset = (char *)s->init_msg - s->init_buf->data;
-
- if (!BUF_MEM_grow_clean(s->init_buf, (int)size))
- return 0;
-
- if (size < msg_offset)
- return 0;
-
- s->init_msg = s->init_buf->data + msg_offset;
-
- return 1;
-}
-
/*
* This function implements the sub-state machine when the message flow is in
* MSG_FLOW_READING. The valid sub-states and transitions are:
@@ -653,14 +637,6 @@ static SUB_STATE_RETURN read_state_machine(SSL_CONNECTION *s)
return SUB_STATE_ERROR;
}
- /* dtls_get_message already did this */
- if (!SSL_CONNECTION_IS_DTLS(s)
- && s->s3.tmp.message_size > 0
- && !grow_init_buf(s, s->s3.tmp.message_size + SSL3_HM_HEADER_LENGTH)) {
- SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_BUF_LIB);
- return SUB_STATE_ERROR;
- }
-
st->read_state = READ_STATE_BODY;
/* Fall through */