]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/x509_internal_test.c
Configure: use $list_separator_re only for defines and includes
[thirdparty/openssl.git] / test / x509_internal_test.c
CommitLineData
f12d6273 1/*
83cf7abf 2 * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
f12d6273
RL
3 *
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10/* Internal tests for the x509 and x509v3 modules */
11
12#include <stdio.h>
13#include <string.h>
14
15#include <openssl/x509.h>
16#include <openssl/x509v3.h>
17#include "testutil.h"
176db6dc 18#include "internal/nelem.h"
f12d6273 19
f12d6273
RL
20/**********************************************************************
21 *
22 * Test of x509v3
23 *
24 ***/
25
edd689ef
RL
26#ifdef __VMS
27# pragma names save
28# pragma names as_is,shortened
29#endif
30
f12d6273
RL
31#include "../crypto/x509v3/ext_dat.h"
32#include "../crypto/x509v3/standard_exts.h"
33
edd689ef
RL
34#ifdef __VMS
35# pragma names restore
36#endif
37
5d99881e 38static int test_standard_exts(void)
f12d6273
RL
39{
40 size_t i;
41 int prev = -1, good = 1;
42 const X509V3_EXT_METHOD **tmp;
43
44 tmp = standard_exts;
45 for (i = 0; i < OSSL_NELEM(standard_exts); i++, tmp++) {
46 if ((*tmp)->ext_nid < prev)
47 good = 0;
48 prev = (*tmp)->ext_nid;
49
50 }
51 if (!good) {
52 tmp = standard_exts;
2fae041d 53 TEST_error("Extensions out of order!");
f12d6273 54 for (i = 0; i < STANDARD_EXTENSION_COUNT; i++, tmp++)
8fe3127c 55 TEST_note("%d : %s", (*tmp)->ext_nid, OBJ_nid2sn((*tmp)->ext_nid));
f12d6273 56 }
f12d6273
RL
57 return good;
58}
59
3cb7c5cf 60int setup_tests(void)
f12d6273 61{
308b876d 62 ADD_TEST(test_standard_exts);
ad887416 63 return 1;
f12d6273 64}