xref: /freebsd/crypto/openssl/crypto/rand/rand_err.c (revision b077aed3)
16f9291ceSJung-uk Kim /*
2e71b7053SJung-uk Kim  * Generated by util/mkerr.pl DO NOT EDIT
3b077aed3SPierre Pronchery  * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
4e71b7053SJung-uk Kim  *
5b077aed3SPierre Pronchery  * Licensed under the Apache License 2.0 (the "License").  You may not use
6e71b7053SJung-uk Kim  * this file except in compliance with the License.  You can obtain a copy
7e71b7053SJung-uk Kim  * in the file LICENSE in the source distribution or at
8e71b7053SJung-uk Kim  * https://www.openssl.org/source/license.html
9f579bf8eSKris Kennaway  */
10f579bf8eSKris Kennaway 
11f579bf8eSKris Kennaway #include <openssl/err.h>
12e71b7053SJung-uk Kim #include <openssl/randerr.h>
13b077aed3SPierre Pronchery #include "crypto/randerr.h"
14f579bf8eSKris Kennaway 
155c87c606SMark Murray #ifndef OPENSSL_NO_ERR
163b4e3dcbSSimon L. B. Nielsen 
17e71b7053SJung-uk Kim static const ERR_STRING_DATA RAND_str_reasons[] = {
18e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ADDITIONAL_INPUT_TOO_LONG),
19e71b7053SJung-uk Kim     "additional input too long"},
20e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ALREADY_INSTANTIATED),
21e71b7053SJung-uk Kim     "already instantiated"},
22e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ARGUMENT_OUT_OF_RANGE),
23e71b7053SJung-uk Kim     "argument out of range"},
24e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_CANNOT_OPEN_FILE), "Cannot open file"},
25e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_DRBG_ALREADY_INITIALIZED),
26e71b7053SJung-uk Kim     "drbg already initialized"},
27e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_DRBG_NOT_INITIALISED),
28e71b7053SJung-uk Kim     "drbg not initialised"},
29e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ENTROPY_INPUT_TOO_LONG),
30e71b7053SJung-uk Kim     "entropy input too long"},
31e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ENTROPY_OUT_OF_RANGE),
32e71b7053SJung-uk Kim     "entropy out of range"},
33e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED),
34e71b7053SJung-uk Kim     "error entropy pool was ignored"},
35e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_INITIALISING_DRBG),
36e71b7053SJung-uk Kim     "error initialising drbg"},
37e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_INSTANTIATING_DRBG),
38e71b7053SJung-uk Kim     "error instantiating drbg"},
39e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT),
40e71b7053SJung-uk Kim     "error retrieving additional input"},
41e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_ENTROPY),
42e71b7053SJung-uk Kim     "error retrieving entropy"},
43e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_ERROR_RETRIEVING_NONCE),
44e71b7053SJung-uk Kim     "error retrieving nonce"},
45e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FAILED_TO_CREATE_LOCK),
46e71b7053SJung-uk Kim     "failed to create lock"},
47e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FUNC_NOT_IMPLEMENTED),
48e71b7053SJung-uk Kim     "Function not implemented"},
49e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FWRITE_ERROR), "Error writing file"},
50e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_GENERATE_ERROR), "generate error"},
51b077aed3SPierre Pronchery     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_INSUFFICIENT_DRBG_STRENGTH),
52b077aed3SPierre Pronchery     "insufficient drbg strength"},
53e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_INTERNAL_ERROR), "internal error"},
54e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_IN_ERROR_STATE), "in error state"},
55e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_A_REGULAR_FILE),
56e71b7053SJung-uk Kim     "Not a regular file"},
57e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_INSTANTIATED), "not instantiated"},
58e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED),
59e71b7053SJung-uk Kim     "no drbg implementation selected"},
60e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PARENT_LOCKING_NOT_ENABLED),
61e71b7053SJung-uk Kim     "parent locking not enabled"},
62e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PARENT_STRENGTH_TOO_WEAK),
63e71b7053SJung-uk Kim     "parent strength too weak"},
64e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PERSONALISATION_STRING_TOO_LONG),
65e71b7053SJung-uk Kim     "personalisation string too long"},
66e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED),
67e71b7053SJung-uk Kim     "prediction resistance not supported"},
68e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PRNG_NOT_SEEDED), "PRNG not seeded"},
69e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RANDOM_POOL_OVERFLOW),
70e71b7053SJung-uk Kim     "random pool overflow"},
71e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RANDOM_POOL_UNDERFLOW),
72e71b7053SJung-uk Kim     "random pool underflow"},
73e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG),
74e71b7053SJung-uk Kim     "request too large for drbg"},
75e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_RESEED_ERROR), "reseed error"},
76e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_SELFTEST_FAILURE), "selftest failure"},
77e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_TOO_LITTLE_NONCE_REQUESTED),
78e71b7053SJung-uk Kim     "too little nonce requested"},
79e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_TOO_MUCH_NONCE_REQUESTED),
80e71b7053SJung-uk Kim     "too much nonce requested"},
81b077aed3SPierre Pronchery     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_CREATE_DRBG),
82b077aed3SPierre Pronchery     "unable to create drbg"},
83b077aed3SPierre Pronchery     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_FETCH_DRBG),
84b077aed3SPierre Pronchery     "unable to fetch drbg"},
85b077aed3SPierre Pronchery     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER),
86b077aed3SPierre Pronchery     "unable to get parent reseed prop counter"},
87b077aed3SPierre Pronchery     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_GET_PARENT_STRENGTH),
88b077aed3SPierre Pronchery     "unable to get parent strength"},
89b077aed3SPierre Pronchery     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNABLE_TO_LOCK_PARENT),
90b077aed3SPierre Pronchery     "unable to lock parent"},
91e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNSUPPORTED_DRBG_FLAGS),
92e71b7053SJung-uk Kim     "unsupported drbg flags"},
93e71b7053SJung-uk Kim     {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_UNSUPPORTED_DRBG_TYPE),
94e71b7053SJung-uk Kim     "unsupported drbg type"},
95f579bf8eSKris Kennaway     {0, NULL}
96f579bf8eSKris Kennaway };
97f579bf8eSKris Kennaway 
98f579bf8eSKris Kennaway #endif
99f579bf8eSKris Kennaway 
ossl_err_load_RAND_strings(void)100b077aed3SPierre Pronchery int ossl_err_load_RAND_strings(void)
101f579bf8eSKris Kennaway {
1025c87c606SMark Murray #ifndef OPENSSL_NO_ERR
103b077aed3SPierre Pronchery     if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
104e71b7053SJung-uk Kim         ERR_load_strings_const(RAND_str_reasons);
1055471f83eSSimon L. B. Nielsen #endif
106e71b7053SJung-uk Kim     return 1;
107f579bf8eSKris Kennaway }
108