summaryrefslogtreecommitdiffstats
path: root/crypto/packet.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-11-17 16:03:00 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:16 +0000
commit6292519cd8102983e9924b6b0d3f298ac5f93e80 (patch)
tree4165c88c36ad9f44df8f5e8526054cd93daccca8 /crypto/packet.c
parent44019a69c4ae305f1f753f836c4d06ac63a8c6f3 (diff)
QUIC: Enable building with QUIC support disabled
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'crypto/packet.c')
-rw-r--r--crypto/packet.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/packet.c b/crypto/packet.c
index feef9d0739..f80774c3c2 100644
--- a/crypto/packet.c
+++ b/crypto/packet.c
@@ -223,6 +223,7 @@ static int put_value(unsigned char *data, uint64_t value, size_t len)
return 1;
}
+#ifndef OPENSSL_NO_QUIC
static int put_quic_value(unsigned char *data, size_t value, size_t len)
{
if (data == NULL)
@@ -235,6 +236,7 @@ static int put_quic_value(unsigned char *data, size_t value, size_t len)
ossl_quic_vlint_encode_n(data, value, len);
return 1;
}
+#endif
/*
* Internal helper function used by WPACKET_close(), WPACKET_finish() and
@@ -272,6 +274,7 @@ static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
unsigned char *buf = GETBUF(pkt);
if (buf != NULL) {
+#ifndef OPENSSL_NO_QUIC
if ((sub->flags & WPACKET_FLAGS_QUIC_VLINT) == 0) {
if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
return 0;
@@ -279,6 +282,10 @@ static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
if (!put_quic_value(&buf[sub->packet_len], packlen, sub->lenbytes))
return 0;
}
+#else
+ if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
+ return 0;
+#endif
}
} else if (pkt->endfirst && sub->parent != NULL
&& (packlen != 0
@@ -524,6 +531,8 @@ void WPACKET_cleanup(WPACKET *pkt)
pkt->subs = NULL;
}
+#ifndef OPENSSL_NO_QUIC
+
int WPACKET_start_quic_sub_packet_bound(WPACKET *pkt, size_t max_len)
{
size_t enclen = ossl_quic_vlint_encode_len(max_len);
@@ -574,3 +583,5 @@ int WPACKET_quic_write_vlint(WPACKET *pkt, uint64_t v)
ossl_quic_vlint_encode(b, v);
return 1;
}
+
+#endif