00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <config.h>
00024
00025 #include <isc/once.h>
00026 #include <isc/util.h>
00027
00028 #include <dst/result.h>
00029 #include <dst/lib.h>
00030
00031 static const char *text[DST_R_NRESULTS] = {
00032 "algorithm is unsupported",
00033 "crypto failure",
00034 "built with no crypto support",
00035 "illegal operation for a null key",
00036 "public key is invalid",
00037 "private key is invalid",
00038 "external key",
00039 "error occurred writing key to disk",
00040 "invalid algorithm specific parameter",
00041 "UNUSED9",
00042 "UNUSED10",
00043 "sign failure",
00044 "UNUSED12",
00045 "UNUSED13",
00046 "verify failure",
00047 "not a public key",
00048 "not a private key",
00049 "not a key that can compute a secret",
00050 "failure computing a shared secret",
00051 "no randomness available",
00052 "bad key type",
00053 "no engine",
00054 "illegal operation for an external key",
00055 };
00056
00057 #define DST_RESULT_RESULTSET 2
00058
00059 static isc_once_t once = ISC_ONCE_INIT;
00060
00061 static void
00062 initialize_action(void) {
00063 isc_result_t result;
00064
00065 result = isc_result_register(ISC_RESULTCLASS_DST, DST_R_NRESULTS,
00066 text, dst_msgcat, DST_RESULT_RESULTSET);
00067 if (result != ISC_R_SUCCESS)
00068 UNEXPECTED_ERROR(__FILE__, __LINE__,
00069 "isc_result_register() failed: %u", result);
00070 }
00071
00072 static void
00073 initialize(void) {
00074 dst_lib_initmsgcat();
00075 RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
00076 }
00077
00078 const char *
00079 dst_result_totext(isc_result_t result) {
00080 initialize();
00081
00082 return (isc_result_totext(result));
00083 }
00084
00085 void
00086 dst_result_register(void) {
00087 initialize();
00088 }
00089
00090