summaryrefslogtreecommitdiffstats
path: root/ssl/packet.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-09-13 15:42:12 +0100
committerMatt Caswell <matt@openssl.org>2016-09-14 00:02:34 +0100
commit869d0a37cfa7cfdbd42026d2b75d14cdc64e81e0 (patch)
tree6be4c4cf435f3f4393493e156a660d4e7d8331ba /ssl/packet.c
parentc9216d1485a350585a7363f46f3e69a840f2d385 (diff)
Encourage use of the macros for the various "sub" functions
Don't call WPACKET_sub_memcpy(), WPACKET_sub_allocation_bytes() and WPACKET_start_sub_packet_len() directly. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/packet.c')
-rw-r--r--ssl/packet.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ssl/packet.c b/ssl/packet.c
index 52c24769f9..7d80ebc689 100644
--- a/ssl/packet.c
+++ b/ssl/packet.c
@@ -41,10 +41,10 @@ int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
return 1;
}
-int WPACKET_sub_allocate_bytes(WPACKET *pkt, size_t len,
- unsigned char **allocbytes, size_t lenbytes)
+int WPACKET_sub_allocate_bytes__(WPACKET *pkt, size_t len,
+ unsigned char **allocbytes, size_t lenbytes)
{
- if (!WPACKET_start_sub_packet_len(pkt, lenbytes)
+ if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
|| !WPACKET_allocate_bytes(pkt, len, allocbytes)
|| !WPACKET_close(pkt))
return 0;
@@ -198,7 +198,7 @@ int WPACKET_finish(WPACKET *pkt)
return ret;
}
-int WPACKET_start_sub_packet_len(WPACKET *pkt, size_t lenbytes)
+int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
{
WPACKET_SUB *sub;
unsigned char *lenchars;
@@ -231,7 +231,7 @@ int WPACKET_start_sub_packet_len(WPACKET *pkt, size_t lenbytes)
int WPACKET_start_sub_packet(WPACKET *pkt)
{
- return WPACKET_start_sub_packet_len(pkt, 0);
+ return WPACKET_start_sub_packet_len__(pkt, 0);
}
int WPACKET_put_bytes(WPACKET *pkt, unsigned int val, size_t size)
@@ -290,9 +290,10 @@ int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
return 1;
}
-int WPACKET_sub_memcpy(WPACKET *pkt, const void *src, size_t len, size_t lenbytes)
+int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len,
+ size_t lenbytes)
{
- if (!WPACKET_start_sub_packet_len(pkt, lenbytes)
+ if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
|| !WPACKET_memcpy(pkt, src, len)
|| !WPACKET_close(pkt))
return 0;