Revision 8aa52c1185e5ec540c7f2f0cb3d5b1f9a0070871 authored by Vladimir Kotal on 07 March 2024, 16:00:07 UTC, committed by Tomas Mraz on 26 March 2024, 14:09:49 UTC
Fixes #23771

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/23773)

(cherry picked from commit 6af739b79ba50bd42ac8934747ab5c8b996f16b6)
1 parent 89ffd55
Raw File
v3name.c
/*
 * Copyright 2012-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 <string.h>
#include <openssl/e_os2.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include "internal/nelem.h"
#include "fuzzer.h"

int FuzzerInitialize(int *argc, char ***argv)
{
    return 1;
}

int FuzzerTestOneInput(const uint8_t* data, size_t size){
    GENERAL_NAME *namesa;
    GENERAL_NAME *namesb;

    const unsigned char *derp = data;
    /*
     * We create two versions of each GENERAL_NAME so that we ensure when
     * we compare them they are always different pointers.
     */
    namesa = d2i_GENERAL_NAME(NULL, &derp, size);
    derp = data;
    namesb = d2i_GENERAL_NAME(NULL, &derp, size);
    GENERAL_NAME_cmp(namesa, namesb);
    if (namesa != NULL)
        GENERAL_NAME_free(namesa);
    if (namesb != NULL)
        GENERAL_NAME_free(namesb);
    return 0;
}

void FuzzerCleanup(void)
{
}
back to top