1 /* ykclient_errors.h --- Error codes used by ykclient.
2  *
3  * Written by Simon Josefsson <simon@josefsson.org>.
4  * Copyright (c) 2006-2013 Yubico AB
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  *    * Redistributions of source code must retain the above copyright
12  *      notice, this list of conditions and the following disclaimer.
13  *
14  *    * Redistributions in binary form must reproduce the above
15  *      copyright notice, this list of conditions and the following
16  *      disclaimer in the documentation and/or other materials provided
17  *      with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 #ifndef YKCLIENT_ERRORS_H
34 #define YKCLIENT_ERRORS_H
35 
36 typedef enum
37 {
38   /* Official yubikey client API errors. */
39   YKCLIENT_OK = 0,
40   YKCLIENT_BAD_OTP,
41   YKCLIENT_REPLAYED_OTP,
42   YKCLIENT_BAD_SIGNATURE,
43   YKCLIENT_MISSING_PARAMETER,
44   YKCLIENT_NO_SUCH_CLIENT,
45   YKCLIENT_OPERATION_NOT_ALLOWED,
46   YKCLIENT_BACKEND_ERROR,
47   YKCLIENT_NOT_ENOUGH_ANSWERS,
48   YKCLIENT_REPLAYED_REQUEST,
49   /* Other implementation specific errors. */
50   YKCLIENT_OUT_OF_MEMORY = 100,
51   YKCLIENT_PARSE_ERROR,
52   YKCLIENT_FORMAT_ERROR,
53   YKCLIENT_CURL_INIT_ERROR,
54   YKCLIENT_HMAC_ERROR,
55   YKCLIENT_HEX_DECODE_ERROR,
56   YKCLIENT_BASE64_DECODE_ERROR,
57   YKCLIENT_BAD_SERVER_SIGNATURE,
58   YKCLIENT_NOT_IMPLEMENTED,
59   YKCLIENT_CURL_PERFORM_ERROR,
60   YKCLIENT_BAD_INPUT,
61   YKCLIENT_HANDLE_NOT_REINIT
62 } ykclient_rc;
63 
64 #endif
65