Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 48e7b18efcd77890f36272b46a4603d15a1ac221 authored by Neil Horman on 26 July 2024, 15:01:05 UTC, committed by Neil Horman on 09 August 2024, 12:28:38 UTC
limit bignums to 128 bytes
Keep us from spinning forever doing huge amounts of math in the fuzzer

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25013)

(cherry picked from commit f0768376e1639d12a328745ef69c90d584138074)
1 parent 67c6330
  • Files
  • Changes
  • 6cdbfeb
  • /
  • include
  • /
  • internal
  • /
  • quic_types.h
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:48e7b18efcd77890f36272b46a4603d15a1ac221 into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:48e7b18efcd77890f36272b46a4603d15a1ac221 as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:48e7b18efcd77890f36272b46a4603d15a1ac221
content badge Iframe embedding
swh:1:cnt:d42164ba56115dc274504dad1322ca1f4138b962
quic_types.h
/*
 * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the Apache License 2.0 (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef OSSL_QUIC_TYPES_H
# define OSSL_QUIC_TYPES_H

# include <openssl/ssl.h>
# include <internal/ssl.h>
# include <assert.h>
# include <string.h>

# ifndef OPENSSL_NO_QUIC

/* QUIC encryption levels. */
enum {
    QUIC_ENC_LEVEL_INITIAL = 0,
    QUIC_ENC_LEVEL_HANDSHAKE,
    QUIC_ENC_LEVEL_0RTT,
    QUIC_ENC_LEVEL_1RTT,
    QUIC_ENC_LEVEL_NUM       /* Must be the ultimate entry */
};

/* QUIC packet number spaces. */
enum {
    QUIC_PN_SPACE_INITIAL = 0,
    QUIC_PN_SPACE_HANDSHAKE,
    /* New entries must go here, so that QUIC_PN_SPACE_APP is the penultimate */
    QUIC_PN_SPACE_APP,
    QUIC_PN_SPACE_NUM       /* Must be the ultimate entry */
};

static ossl_unused ossl_inline uint32_t
ossl_quic_enc_level_to_pn_space(uint32_t enc_level)
{
    switch (enc_level) {
    case QUIC_ENC_LEVEL_INITIAL:
        return QUIC_PN_SPACE_INITIAL;
    case QUIC_ENC_LEVEL_HANDSHAKE:
        return QUIC_PN_SPACE_HANDSHAKE;
    case QUIC_ENC_LEVEL_0RTT:
    case QUIC_ENC_LEVEL_1RTT:
        return QUIC_PN_SPACE_APP;
    default:
        assert(0);
        return QUIC_PN_SPACE_APP;
    }
}

/* QUIC packet number representation. */
typedef uint64_t QUIC_PN;
#  define QUIC_PN_INVALID            UINT64_MAX

static ossl_unused ossl_inline QUIC_PN ossl_quic_pn_max(QUIC_PN a, QUIC_PN b)
{
    return a > b ? a : b;
}

static ossl_unused ossl_inline QUIC_PN ossl_quic_pn_min(QUIC_PN a, QUIC_PN b)
{
    return a < b ? a : b;
}

static ossl_unused ossl_inline int ossl_quic_pn_valid(QUIC_PN pn)
{
    return pn < (((QUIC_PN)1) << 62);
}

/* QUIC connection ID representation. */
#  define QUIC_MAX_CONN_ID_LEN   20

typedef struct quic_conn_id_st {
    unsigned char id_len, id[QUIC_MAX_CONN_ID_LEN];
} QUIC_CONN_ID;

static ossl_unused ossl_inline int ossl_quic_conn_id_eq(const QUIC_CONN_ID *a,
                                                        const QUIC_CONN_ID *b)
{
    if (a->id_len != b->id_len || a->id_len > QUIC_MAX_CONN_ID_LEN)
        return 0;
    return memcmp(a->id, b->id, a->id_len) == 0;
}

#  define QUIC_MIN_INITIAL_DGRAM_LEN  1200

#  define QUIC_DEFAULT_ACK_DELAY_EXP  3
#  define QUIC_MAX_ACK_DELAY_EXP      20

#  define QUIC_DEFAULT_MAX_ACK_DELAY  25

#  define QUIC_MIN_ACTIVE_CONN_ID_LIMIT   2

/* Arbitrary choice of default idle timeout (not an RFC value). */
#  define QUIC_DEFAULT_IDLE_TIMEOUT   30000

#  define QUIC_STATELESS_RESET_TOKEN_LEN    16

typedef struct {
    unsigned char token[QUIC_STATELESS_RESET_TOKEN_LEN];
} QUIC_STATELESS_RESET_TOKEN;

/*
 * An encoded preferred_addr transport parameter cannot be shorter or longer
 * than these lengths in bytes.
 */
#  define QUIC_MIN_ENCODED_PREFERRED_ADDR_LEN   41
#  define QUIC_MAX_ENCODED_PREFERRED_ADDR_LEN   61

# endif

#endif
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top