aboutsummaryrefslogtreecommitdiff
path: root/ssl/packet_locl.h
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-01-13 16:59:18 +0000
committerMatt Caswell <matt@openssl.org>2017-01-30 10:17:52 +0000
commita2b7e65526d92123f143cc7f248b4ac017372faf (patch)
treea3e48eb5b683558de0c0a97504802ea61dcc2bd6 /ssl/packet_locl.h
parentbe62b22b527e89061f88c0b9eaefb0410982f41e (diff)
downloadopenssl-a2b7e65526d92123f143cc7f248b4ac017372faf.zip
openssl-a2b7e65526d92123f143cc7f248b4ac017372faf.tar.gz
openssl-a2b7e65526d92123f143cc7f248b4ac017372faf.tar.bz2
Provide a new WPACKET function for filling in all the lengths
For the psk extension we need to fill in all the lengths of the message so far, even though we haven't closed the WPACKET yet. This provides a function to do that. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2259)
Diffstat (limited to 'ssl/packet_locl.h')
-rw-r--r--ssl/packet_locl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h
index 61233d9..cd70265 100644
--- a/ssl/packet_locl.h
+++ b/ssl/packet_locl.h
@@ -700,6 +700,15 @@ int WPACKET_close(WPACKET *pkt);
int WPACKET_finish(WPACKET *pkt);
/*
+ * Iterates through all the sub-packets and writes out their lengths as if they
+ * were being closed. The lengths will be overwritten with the final lengths
+ * when the sub-packets are eventually closed (which may be different if more
+ * data is added to the WPACKET). This function will fail if a sub-packet is of
+ * 0 length and WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH is used.
+ */
+int WPACKET_fill_lengths(WPACKET *pkt);
+
+/*
* Initialise a new sub-packet. Additionally |lenbytes| of data is preallocated
* at the start of the sub-packet to store its length once we know it. Don't
* call this directly. Use the convenience macros below instead.