5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2000 - 2002 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
20 /****h* silcske/SKE Status Types
24 * Defines the SilcSKEStatus type, that is returned by all SKE routines,
25 * and a utility interface for handling the status.
29 #ifndef SILCSKE_STATUS_H
30 #define SILCSKE_STATUS_H
32 /****d* silcske/SilcSKEStatuses/SilcSKEStatus
36 * typedef enum { ... } SilcSKEStatus;
40 * Status types returned by all SKE routines. This tell the status of
41 * the SKE session, and if an error occurred.
46 /* These are defined by the protocol */
47 SILC_SKE_STATUS_OK = 0, /* No error */
48 SILC_SKE_STATUS_ERROR = 1, /* Unknown error */
49 SILC_SKE_STATUS_BAD_PAYLOAD = 2, /* Malformed payload */
50 SILC_SKE_STATUS_UNKNOWN_GROUP = 3, /* Unsupported DH group */
51 SILC_SKE_STATUS_UNKNOWN_CIPHER = 4, /* Unsupported cipher */
52 SILC_SKE_STATUS_UNKNOWN_PKCS = 5, /* Unsupported PKCS algorithm */
53 SILC_SKE_STATUS_UNKNOWN_HASH_FUNCTION = 6, /* Unsupported hash function */
54 SILC_SKE_STATUS_UNKNOWN_HMAC = 7, /* Unsupported HMAC */
55 SILC_SKE_STATUS_UNSUPPORTED_PUBLIC_KEY = 8, /* Unsupported/not trusted PK */
56 SILC_SKE_STATUS_INCORRECT_SIGNATURE = 9, /* Incorrect signature */
57 SILC_SKE_STATUS_BAD_VERSION = 10, /* Unsupported version */
58 SILC_SKE_STATUS_INVALID_COOKIE = 11, /* Cookie was modified */
60 /* Implementation specific status types */
61 SILC_SKE_STATUS_PENDING, /* SKE library is pending */
62 SILC_SKE_STATUS_PUBLIC_KEY_NOT_PROVIDED, /* Remote did not send PK */
63 SILC_SKE_STATUS_KEY_EXCHANGE_NOT_ACTIVE, /* SKE is not started */
64 SILC_SKE_STATUS_BAD_RESERVED_FIELD, /* Reserved field was not 0 */
65 SILC_SKE_STATUS_BAD_PAYLOAD_LENGTH, /* Payload includes garbage */
67 /* Other internal status types */
68 SILC_SKE_STATUS_FREED, /* Internal library status */
72 /****f* silcske/SilcSKEStatuses/silc_ske_map_status
76 * const char *silc_ske_map_status(SilcSKEStatus status);
80 * Utility function to map the `status' into human readable message.
83 const char *silc_ske_map_status(SilcSKEStatus status);
85 #endif /* SILCSKE_STATUS_H */