diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-11-17 16:03:00 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-01-13 13:20:16 +0000 |
commit | 6292519cd8102983e9924b6b0d3f298ac5f93e80 (patch) | |
tree | 4165c88c36ad9f44df8f5e8526054cd93daccca8 /crypto | |
parent | 44019a69c4ae305f1f753f836c4d06ac63a8c6f3 (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')
-rw-r--r-- | crypto/packet.c | 11 | ||||
-rw-r--r-- | crypto/quic_vlint.c | 4 |
2 files changed, 15 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 diff --git a/crypto/quic_vlint.c b/crypto/quic_vlint.c index 92f14c6d77..0238985963 100644 --- a/crypto/quic_vlint.c +++ b/crypto/quic_vlint.c @@ -1,6 +1,8 @@ #include "internal/quic_vlint.h" #include "internal/e_os.h" +#ifndef OPENSSL_NO_QUIC + void ossl_quic_vlint_encode_n(uint8_t *buf, uint64_t v, int n) { if (n == 1) { @@ -75,3 +77,5 @@ int ossl_quic_vlint_decode(const unsigned char *buf, size_t buf_len, uint64_t *v *v = x; return dec_len; } + +#endif |