There is only one caller of this function and it
wants it to be size_t. So move the size_t to int
conversion one step down in the call chain. Do not
switch key_state_write_plaintext_const, yet, since
that is a backend function and so needs way more
work.
Change-Id: Ic90c5a0e48bda4a02d5e11c4c161f388cc8805af
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1355
Message-Id: <
20251111155239.31747-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34320.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
}
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
bool
send_control_channel_string_dowork(struct tls_session *session, const char *str,
msglvl_t msglevel)
#endif /* ENABLE_MANAGEMENT */
}
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+
static void
check_coarse_timers(struct context *c)
{
*/
bool
-tls_send_payload(struct key_state *ks, const uint8_t *data, int size)
+tls_send_payload(struct key_state *ks, const uint8_t *data, size_t size)
{
bool ret = false;
if (ks->state >= S_ACTIVE)
{
- if (key_state_write_plaintext_const(&ks->ks_ssl, data, size) == 1)
+ ASSERT(size <= INT_MAX);
+ if (key_state_write_plaintext_const(&ks->ks_ssl, data, (int)size) == 1)
{
ret = true;
}
{
ks->paybuf = buffer_list_new();
}
- buffer_list_push_data(ks->paybuf, data, (size_t)size);
+ buffer_list_push_data(ks->paybuf, data, size);
ret = true;
}
/*
* Send a payload over the TLS control channel
*/
-bool tls_send_payload(struct key_state *ks, const uint8_t *data, int size);
+bool tls_send_payload(struct key_state *ks, const uint8_t *data, size_t size);
/*
* Receive a payload through the TLS control channel