2 * Copyright 2023-2024 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (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
10 #include <openssl/evp.h>
13 static char *config_file
= NULL
;
15 typedef enum OPTION_choice
{
22 const OPTIONS
*test_get_options(void)
24 static const OPTIONS options
[] = {
25 OPT_TEST_OPTIONS_DEFAULT_USAGE
,
26 { "config", OPT_CONFIG_FILE
, '<',
27 "The configuration file to use for the libctx" },
35 * Test that parsing a config file with incorrect stable settings aren't parsed
36 * and appropriate errors are raised
38 static int test_asn1_stable_parse(void)
41 unsigned long errcode
;
42 OSSL_LIB_CTX
*newctx
= OSSL_LIB_CTX_new();
44 if (!TEST_ptr(newctx
))
47 if (!TEST_int_eq(OSSL_LIB_CTX_load_config(newctx
, config_file
), 0))
50 errcode
= ERR_peek_error();
51 if (ERR_GET_LIB(errcode
) != ERR_LIB_ASN1
)
53 if (ERR_GET_REASON(errcode
) != ASN1_R_INVALID_STRING_TABLE_VALUE
)
60 OSSL_LIB_CTX_free(newctx
);
69 while ((o
= opt_next()) != OPT_EOF
) {
72 config_file
= opt_arg();
79 ADD_TEST(test_asn1_stable_parse
);