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 2a6305dfcd89632b69e49f8b3efe98b7e0daa1aa authored by dependabot[bot] on 03 September 2024, 22:45:53 UTC, committed by Tomas Mraz on 04 September 2024, 06:48:29 UTC
build(deps): bump actions/download-artifact in /.github/workflows
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
CLA: trivial

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25374)
1 parent bbe4571
  • Files
  • Changes
  • c16d0c9
  • /
  • test
  • /
  • quic_srtm_test.c
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:2a6305dfcd89632b69e49f8b3efe98b7e0daa1aa 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:2a6305dfcd89632b69e49f8b3efe98b7e0daa1aa 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:2a6305dfcd89632b69e49f8b3efe98b7e0daa1aa
content badge Iframe embedding
swh:1:cnt:558e323cd6ea25ad918bbe3ecdb50fe6c176513d
quic_srtm_test.c
/*
 * Copyright 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
 */

#include "internal/quic_srtm.h"
#include "testutil.h"

static char ptrs[8];

static const QUIC_STATELESS_RESET_TOKEN token_1 = {{
    0x01, 0x02, 0x03, 0x04
}};

static const QUIC_STATELESS_RESET_TOKEN token_2 = {{
    0x01, 0x02, 0x03, 0x05
}};

static int test_srtm(void)
{
    int testresult = 0;
    QUIC_SRTM *srtm;
    void *opaque = NULL;
    uint64_t seq_num = 0;

    if (!TEST_ptr(srtm = ossl_quic_srtm_new(NULL, NULL)))
        goto err;

    if (!TEST_true(ossl_quic_srtm_add(srtm, ptrs + 0, 0, &token_1))
        || !TEST_false(ossl_quic_srtm_add(srtm, ptrs + 0, 0, &token_1))
        || !TEST_false(ossl_quic_srtm_remove(srtm, ptrs + 0, 1))
        || !TEST_false(ossl_quic_srtm_remove(srtm, ptrs + 3, 0))
        || !TEST_true(ossl_quic_srtm_cull(srtm, ptrs + 3))
        || !TEST_true(ossl_quic_srtm_cull(srtm, ptrs + 3))
        || !TEST_true(ossl_quic_srtm_add(srtm, ptrs + 0, 1, &token_1))
        || !TEST_true(ossl_quic_srtm_add(srtm, ptrs + 0, 2, &token_1))
        || !TEST_true(ossl_quic_srtm_add(srtm, ptrs + 0, 3, &token_1))
        || !TEST_true(ossl_quic_srtm_add(srtm, ptrs + 1, 0, &token_1))
        || !TEST_true(ossl_quic_srtm_add(srtm, ptrs + 2, 0, &token_2))
        || !TEST_true(ossl_quic_srtm_add(srtm, ptrs + 3, 3, &token_2))
        || !TEST_true(ossl_quic_srtm_remove(srtm, ptrs + 3, 3))
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_1, 0, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 1)
        || !TEST_uint64_t_eq(seq_num, 0)
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_1, 1, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 0)
        || !TEST_uint64_t_eq(seq_num, 3)
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_1, 2, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 0)
        || !TEST_uint64_t_eq(seq_num, 2)
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_1, 3, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 0)
        || !TEST_uint64_t_eq(seq_num, 1)
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_1, 4, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 0)
        || !TEST_uint64_t_eq(seq_num, 0)
        || !TEST_false(ossl_quic_srtm_lookup(srtm, &token_1, 5, &opaque, &seq_num))
        || !TEST_true(ossl_quic_srtm_cull(srtm, ptrs + 0))
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_1, 0, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 1)
        || !TEST_uint64_t_eq(seq_num, 0)
        || !TEST_true(ossl_quic_srtm_lookup(srtm, &token_2, 0, &opaque, &seq_num))
        || !TEST_ptr_eq(opaque, ptrs + 2)
        || !TEST_uint64_t_eq(seq_num, 0)
        || !TEST_true(ossl_quic_srtm_remove(srtm, ptrs + 2, 0))
        || !TEST_false(ossl_quic_srtm_lookup(srtm, &token_2, 0, &opaque, &seq_num))
       )
        goto err;

    testresult = 1;
err:
    ossl_quic_srtm_free(srtm);
    return testresult;
}

int setup_tests(void)
{
    ADD_TEST(test_srtm);
    return 1;
}
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