OLD | NEW |
1 /* crypto/rand/rand_err.c */ | 1 /* crypto/rand/rand_err.c */ |
2 /* ==================================================================== | 2 /* ==================================================================== |
3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. | 3 * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
11 * | 11 * |
12 * 2. Redistributions in binary form must reproduce the above copyright | 12 * 2. Redistributions in binary form must reproduce the above copyright |
13 * notice, this list of conditions and the following disclaimer in | 13 * notice, this list of conditions and the following disclaimer in |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include <openssl/rand.h> | 63 #include <openssl/rand.h> |
64 | 64 |
65 /* BEGIN ERROR CODES */ | 65 /* BEGIN ERROR CODES */ |
66 #ifndef OPENSSL_NO_ERR | 66 #ifndef OPENSSL_NO_ERR |
67 | 67 |
68 #define ERR_FUNC(func) ERR_PACK(ERR_LIB_RAND,func,0) | 68 #define ERR_FUNC(func) ERR_PACK(ERR_LIB_RAND,func,0) |
69 #define ERR_REASON(reason) ERR_PACK(ERR_LIB_RAND,0,reason) | 69 #define ERR_REASON(reason) ERR_PACK(ERR_LIB_RAND,0,reason) |
70 | 70 |
71 static ERR_STRING_DATA RAND_str_functs[]= | 71 static ERR_STRING_DATA RAND_str_functs[]= |
72 { | 72 { |
73 {ERR_FUNC(RAND_F_ENG_RAND_GET_RAND_METHOD), "ENG_RAND_GET_RAND_METHOD"}, | |
74 {ERR_FUNC(RAND_F_FIPS_RAND), "FIPS_RAND"}, | |
75 {ERR_FUNC(RAND_F_FIPS_RAND_BYTES), "FIPS_RAND_BYTES"}, | |
76 {ERR_FUNC(RAND_F_FIPS_RAND_GET_RAND_METHOD), "FIPS_RAND_GET_RAND_METHOD"}, | |
77 {ERR_FUNC(RAND_F_FIPS_RAND_SET_DT), "FIPS_RAND_SET_DT"}, | |
78 {ERR_FUNC(RAND_F_FIPS_SET_DT), "FIPS_SET_DT"}, | |
79 {ERR_FUNC(RAND_F_FIPS_SET_PRNG_SEED), "FIPS_SET_PRNG_SEED"}, | |
80 {ERR_FUNC(RAND_F_FIPS_SET_TEST_MODE), "FIPS_SET_TEST_MODE"}, | |
81 {ERR_FUNC(RAND_F_RAND_GET_RAND_METHOD), "RAND_get_rand_method"}, | 73 {ERR_FUNC(RAND_F_RAND_GET_RAND_METHOD), "RAND_get_rand_method"}, |
82 {ERR_FUNC(RAND_F_SSLEAY_RAND_BYTES), "SSLEAY_RAND_BYTES"}, | 74 {ERR_FUNC(RAND_F_SSLEAY_RAND_BYTES), "SSLEAY_RAND_BYTES"}, |
83 {0,NULL} | 75 {0,NULL} |
84 }; | 76 }; |
85 | 77 |
86 static ERR_STRING_DATA RAND_str_reasons[]= | 78 static ERR_STRING_DATA RAND_str_reasons[]= |
87 { | 79 { |
88 {ERR_REASON(RAND_R_NON_FIPS_METHOD) ,"non fips method"}, | |
89 {ERR_REASON(RAND_R_NOT_IN_TEST_MODE) ,"not in test mode"}, | |
90 {ERR_REASON(RAND_R_NO_KEY_SET) ,"no key set"}, | |
91 {ERR_REASON(RAND_R_PRNG_ASKING_FOR_TOO_MUCH),"prng asking for too much"}, | |
92 {ERR_REASON(RAND_R_PRNG_ERROR) ,"prng error"}, | |
93 {ERR_REASON(RAND_R_PRNG_KEYED) ,"prng keyed"}, | |
94 {ERR_REASON(RAND_R_PRNG_NOT_REKEYED) ,"prng not rekeyed"}, | |
95 {ERR_REASON(RAND_R_PRNG_NOT_RESEEDED) ,"prng not reseeded"}, | |
96 {ERR_REASON(RAND_R_PRNG_NOT_SEEDED) ,"PRNG not seeded"}, | 80 {ERR_REASON(RAND_R_PRNG_NOT_SEEDED) ,"PRNG not seeded"}, |
97 {ERR_REASON(RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY),"prng seed must not match key"}
, | |
98 {ERR_REASON(RAND_R_PRNG_STUCK) ,"prng stuck"}, | |
99 {0,NULL} | 81 {0,NULL} |
100 }; | 82 }; |
101 | 83 |
102 #endif | 84 #endif |
103 | 85 |
104 void ERR_load_RAND_strings(void) | 86 void ERR_load_RAND_strings(void) |
105 { | 87 { |
106 #ifndef OPENSSL_NO_ERR | 88 #ifndef OPENSSL_NO_ERR |
107 | 89 |
108 if (ERR_func_error_string(RAND_str_functs[0].error) == NULL) | 90 if (ERR_func_error_string(RAND_str_functs[0].error) == NULL) |
109 { | 91 { |
110 ERR_load_strings(0,RAND_str_functs); | 92 ERR_load_strings(0,RAND_str_functs); |
111 ERR_load_strings(0,RAND_str_reasons); | 93 ERR_load_strings(0,RAND_str_reasons); |
112 } | 94 } |
113 #endif | 95 #endif |
114 } | 96 } |
OLD | NEW |