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 f6b2ab0ba4fede20d7fdc81a0b281d3470a4d6e9 authored by Jonathan M. Wilbur on 21 August 2024, 02:25:03 UTC, committed by Tomas Mraz on 10 September 2024, 17:17:34 UTC
test: authorityAttributeIdentifier X.509v3 extension
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25244)
1 parent 221e8fa
  • Files
  • Changes
  • 0b326f3
  • /
  • test
  • /
  • ext_internal_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:f6b2ab0ba4fede20d7fdc81a0b281d3470a4d6e9 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:f6b2ab0ba4fede20d7fdc81a0b281d3470a4d6e9 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:f6b2ab0ba4fede20d7fdc81a0b281d3470a4d6e9
content badge Iframe embedding
swh:1:cnt:20cf708de27a311623d8602facea4cf8a65fd610
ext_internal_test.c
/*
 * Copyright 1995-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/nelem.h"
#include "../ssl/ssl_local.h"
#include "../ssl/statem/statem_local.h"
#include "testutil.h"

#define EXT_ENTRY(name) { TLSEXT_IDX_##name, TLSEXT_TYPE_##name, #name }
#define EXT_EXCEPTION(name) { TLSEXT_IDX_##name, TLSEXT_TYPE_invalid, #name }
#define EXT_END(name) { TLSEXT_IDX_##name, TLSEXT_TYPE_out_of_range, #name }

typedef struct {
    size_t idx;
    unsigned int type;
    char *name;
} EXT_LIST;

/* The order here does matter! */
static EXT_LIST ext_list[] = {

    EXT_ENTRY(renegotiate),
    EXT_ENTRY(server_name),
    EXT_ENTRY(max_fragment_length),
#ifndef OPENSSL_NO_SRP
    EXT_ENTRY(srp),
#else
    EXT_EXCEPTION(srp),
#endif
    EXT_ENTRY(ec_point_formats),
    EXT_ENTRY(supported_groups),
    EXT_ENTRY(session_ticket),
#ifndef OPENSSL_NO_OCSP
    EXT_ENTRY(status_request),
#else
    EXT_EXCEPTION(status_request),
#endif
#ifndef OPENSSL_NO_NEXTPROTONEG
    EXT_ENTRY(next_proto_neg),
#else
    EXT_EXCEPTION(next_proto_neg),
#endif
    EXT_ENTRY(application_layer_protocol_negotiation),
#ifndef OPENSSL_NO_SRTP
    EXT_ENTRY(use_srtp),
#else
    EXT_EXCEPTION(use_srtp),
#endif
    EXT_ENTRY(encrypt_then_mac),
#ifndef OPENSSL_NO_CT
    EXT_ENTRY(signed_certificate_timestamp),
#else
    EXT_EXCEPTION(signed_certificate_timestamp),
#endif
    EXT_ENTRY(extended_master_secret),
    EXT_ENTRY(signature_algorithms_cert),
    EXT_ENTRY(post_handshake_auth),
    EXT_ENTRY(client_cert_type),
    EXT_ENTRY(server_cert_type),
    EXT_ENTRY(signature_algorithms),
    EXT_ENTRY(supported_versions),
    EXT_ENTRY(psk_kex_modes),
    EXT_ENTRY(key_share),
    EXT_ENTRY(cookie),
    EXT_ENTRY(cryptopro_bug),
    EXT_ENTRY(compress_certificate),
    EXT_ENTRY(early_data),
    EXT_ENTRY(certificate_authorities),
    EXT_ENTRY(padding),
    EXT_ENTRY(psk),
    EXT_END(num_builtins)
};

static int test_extension_list(void)
{
    size_t n = OSSL_NELEM(ext_list);
    size_t i;
    unsigned int type;
    int retval = 1;

    for (i = 0; i < n; i++) {
        if (!TEST_size_t_eq(i, ext_list[i].idx)) {
            retval = 0;
            TEST_error("TLSEXT_IDX_%s=%zd, found at=%zd\n",
                       ext_list[i].name, ext_list[i].idx, i);
        }
        type = ossl_get_extension_type(ext_list[i].idx);
        if (!TEST_uint_eq(type, ext_list[i].type)) {
            retval = 0;
            TEST_error("TLSEXT_IDX_%s=%zd expected=0x%05X got=0x%05X",
                       ext_list[i].name, ext_list[i].idx, ext_list[i].type,
                       type);
        }
    }
    return retval;
}

int setup_tests(void)
{
    ADD_TEST(test_extension_list);
    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