rand_err.c 1.4 KB
Newer Older
1
/*
R
Rich Salz 已提交
2
 * Generated by util/mkerr.pl DO NOT EDIT
3
 * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
4
 *
5 6 7 8
 * 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
9 10 11
 */

#include <openssl/err.h>
12
#include <openssl/randerr.h>
13

14
#ifndef OPENSSL_NO_ERR
D
Dr. Stephen Henson 已提交
15

16 17
static const ERR_STRING_DATA RAND_str_functs[] = {
    {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_BYTES, 0), "RAND_bytes"},
18 19
    {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_LOAD_FILE, 0), "RAND_load_file"},
    {ERR_PACK(ERR_LIB_RAND, RAND_F_RAND_WRITE_FILE, 0), "RAND_write_file"},
20 21
    {0, NULL}
};
22

23
static const ERR_STRING_DATA RAND_str_reasons[] = {
24
    {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_CANNOT_OPEN_FILE), "Cannot open file"},
R
Rich Salz 已提交
25 26
    {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FUNC_NOT_IMPLEMENTED),
    "Function not implemented"},
27 28 29
    {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_FWRITE_ERROR), "Error writing file"},
    {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_NOT_A_REGULAR_FILE),
    "Not a regular file"},
30
    {ERR_PACK(ERR_LIB_RAND, 0, RAND_R_PRNG_NOT_SEEDED), "PRNG not seeded"},
31 32
    {0, NULL}
};
33 34 35

#endif

36
int ERR_load_RAND_strings(void)
37
{
38
#ifndef OPENSSL_NO_ERR
39
    if (ERR_func_error_string(RAND_str_functs[0].error) == NULL) {
40 41
        ERR_load_strings_const(RAND_str_functs);
        ERR_load_strings_const(RAND_str_reasons);
42
    }
43
#endif
44
    return 1;
45
}