This returns not just the buffer of a reliable_entry but the whole
entry. This allows the caller to also inspect the original opcode
and packet id.
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <
20220422142953.
3805364-11-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24153.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
}
/* get active buffer for next sequentially increasing key ID */
-struct buffer *
-reliable_get_buf_sequenced(struct reliable *rel)
+struct reliable_entry *
+reliable_get_entry_sequenced(struct reliable *rel)
{
int i;
for (i = 0; i < rel->size; ++i)
struct reliable_entry *e = &rel->array[i];
if (e->active && e->packet_id == rel->packet_id)
{
- return &e->buf;
+ return e;
}
}
return NULL;
* @param rel The reliable structure from which to retrieve the
* buffer.
*
- * @return A pointer to the buffer of the entry with the next
- * sequential key ID. If no such entry is present, this function
- * returns NULL.
+ * @return A pointer to the entry with the next sequential key ID.
+ * If no such entry is present, this function returns NULL.
*/
-struct buffer *reliable_get_buf_sequenced(struct reliable *rel);
+struct reliable_entry *reliable_get_entry_sequenced(struct reliable *rel);
/**
* Remove an entry from a reliable structure.
}
/* Write incoming ciphertext to TLS object */
- struct buffer *buf = reliable_get_buf_sequenced(ks->rec_reliable);
- if (buf)
+ struct reliable_entry *entry = reliable_get_entry_sequenced(ks->rec_reliable);
+ if (entry)
{
+ struct buffer *buf = &entry->buf;
int status = 0;
if (buf->len)
{
}
/* Read incoming plaintext from TLS object */
- buf = &ks->plaintext_read_buf;
+ struct buffer *buf = &ks->plaintext_read_buf;
if (!buf->len)
{
int status;