Commit b99fe5f4 authored by Pauli's avatar Pauli
Browse files

Remove tests dependence on e_os.h



Apart from ssltest_old.c, the test suite relied on e_os.h for the
OSSL_NELEM macro and nothing else.

The ssltest_old.c also requires EXIT and some socket macros.

Create a new header to define the OSSL_NELEM macro and use that instead.

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4186)
parent 524fdd51
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
@@ -14,6 +14,8 @@

# include <openssl/e_os2.h>
# include <openssl/crypto.h>
# include <internal/nelem.h>

/*
 * <openssl/e_os2.h> contains what we can justify to make visible to the
 * outside; this file e_os.h is not part of the exported interface.
@@ -540,8 +542,6 @@ struct servent *getservbyname(const char *name, const char *proto);
# endif
/* end vxworks */

#define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))

#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# define CRYPTO_memcmp memcmp
#endif
+14 −0
Original line number Diff line number Diff line
/*
 * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (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 HEADER_NELEM_H
# define HEADER_NELEM_H

# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
#endif
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "testutil.h"
#include "e_os.h"
#include <internal/nelem.h>

/**********************************************************************
 *
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "testutil.h"
#include "e_os.h"
#include <internal/nelem.h>

struct testdata {
    char *data;             /* TIME string value */
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
#include <openssl/kdf.h>

#include "../ssl/packet_locl.h"
#include "../e_os.h" /* for OSSL_NELEM() */
#include <internal/nelem.h>

#include "testutil.h"

Loading