2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2001 Internet Software Consortium.
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
19 * Principal Author: Brian Wellington
20 * $Id: dst_result.c,v 1.1.4.1 2004/12/09 04:07:17 marka Exp $
28 #include <dst/result.h>
31 static const char *text[DST_R_NRESULTS] = {
32 "algorithm is unsupported", /* 0 */
33 "openssl failure", /* 1 */
34 "built with no crypto support", /* 2 */
35 "illegal operation for a null key", /* 3 */
36 "public key is invalid", /* 4 */
37 "private key is invalid", /* 5 */
39 "error occurred writing key to disk", /* 7 */
40 "invalid algorithm specific parameter", /* 8 */
43 "sign failure", /* 11 */
46 "verify failure", /* 14 */
47 "not a public key", /* 15 */
48 "not a private key", /* 16 */
49 "not a key that can compute a secret", /* 17 */
50 "failure computing a shared secret", /* 18 */
51 "no randomness available", /* 19 */
52 "bad key type" /* 20 */
55 #define DST_RESULT_RESULTSET 2
57 static isc_once_t once = ISC_ONCE_INIT;
60 initialize_action(void) {
63 result = isc_result_register(ISC_RESULTCLASS_DST, DST_R_NRESULTS,
64 text, dst_msgcat, DST_RESULT_RESULTSET);
65 if (result != ISC_R_SUCCESS)
66 UNEXPECTED_ERROR(__FILE__, __LINE__,
67 "isc_result_register() failed: %u", result);
73 RUNTIME_CHECK(isc_once_do(&once, initialize_action) == ISC_R_SUCCESS);
77 dst_result_totext(isc_result_t result) {
80 return (isc_result_totext(result));
84 dst_result_register(void) {