Changes needed to support smartcards. Well, only _support_. There is
[gnupg.git] / common / errors.h
1 /* errors.h - Globally used error codes
2  *      Copyright (C) 2001 Free Software Foundation, Inc.
3  *
4  * This file is part of GnuPG.
5  *
6  * GnuPG is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * GnuPG is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19  */
20
21 #ifndef GNUPG_COMMON_ERRORS_H
22 #define GNUPG_COMMON_ERRORS_H
23
24 #include "util.h"
25
26 /* Error numbers */
27 enum {
28   GNUPG_EOF = -1,
29   GNUPG_No_Error = 0,
30   GNUPG_General_Error = 1, 
31   GNUPG_Out_Of_Core = 2,
32   GNUPG_Invalid_Value = 3,
33   GNUPG_IO_Error = 4,
34   GNUPG_Resource_Limit = 5,
35   GNUPG_Internal_Error = 6,
36   GNUPG_Bad_Certificate = 7,
37   GNUPG_Bad_Certificate_Path = 8,
38   GNUPG_Missing_Certificate = 9,
39   GNUPG_No_Data = 10,
40   GNUPG_Bad_Signature = 11,
41   GNUPG_Not_Implemented = 12,
42   GNUPG_Conflict = 13,
43   GNUPG_Bug = 14,
44   GNUPG_Read_Error = 15,
45   GNUPG_Write_Error = 16,
46   GNUPG_Incomplete_Line = 17,
47   GNUPG_Invalid_Response = 18,
48   GNUPG_No_Agent = 19,
49   GNUPG_Agent_Error = 20,
50   GNUPG_No_Public_Key = 21,
51   GNUPG_No_Secret_Key = 22,
52   GNUPG_File_Open_Error = 23,
53   GNUPG_File_Create_Error = 24,
54   GNUPG_File_Error = 25,
55   GNUPG_Not_Supported = 26,
56   GNUPG_Invalid_Data = 27,
57   GNUPG_Assuan_Server_Fault = 28,
58   GNUPG_Assuan_Error = 29, /* catch all assuan error */
59   GNUPG_Invalid_Session_Key = 30,
60   GNUPG_Invalid_Sexp = 31,
61   GNUPG_Unsupported_Algorithm = 32,
62   GNUPG_No_PIN_Entry = 33,
63   GNUPG_PIN_Entry_Error = 34,
64   GNUPG_Bad_PIN = 35,
65   GNUPG_Bad_Passphrase = 36,
66   GNUPG_Invalid_Name = 37,
67   GNUPG_Bad_Public_Key = 38,
68   GNUPG_Bad_Secret_Key = 39,
69   GNUPG_Bad_Data = 40,
70   GNUPG_Invalid_Parameter = 41,
71   GNUPG_Tribute_to_D_A = 42,
72   GNUPG_No_Dirmngr = 43,
73   GNUPG_Dirmngr_Error = 44,
74   GNUPG_Certificate_Revoked = 45,
75   GNUPG_No_CRL_Known = 46,
76   GNUPG_CRL_Too_Old = 47,
77   GNUPG_Line_Too_Long = 48,
78   GNUPG_Not_Trusted = 49,
79   GNUPG_Canceled = 50,
80   GNUPG_Bad_CA_Certificate = 51,
81   GNUPG_Certificate_Expired = 52,
82   GNUPG_Certificate_Too_Young = 53,
83   GNUPG_Unsupported_Certificate = 54,
84   GNUPG_Unknown_Sexp = 55,
85   GNUPG_Unsupported_Protection = 56,
86   GNUPG_Corrupted_Protection = 57,
87   GNUPG_Ambiguous_Name = 58,
88   GNUPG_Card_Error = 59,
89   GNUPG_Card_Reset = 60,
90   GNUPG_Card_Removed = 61,
91   GNUPG_Invalid_Card = 62,
92   GNUPG_Card_Not_Present = 63,
93   GNUPG_No_PKCS15_App = 64,
94   GNUPG_Not_Confirmed = 65,
95   GNUPG_Configuration_Error = 66,
96   GNUPG_No_Policy_Match = 67,
97   GNUPG_Invalid_Index = 68,
98   GNUPG_Invalid_Id = 69,
99   GNUPG_No_Scdaemon = 70,
100   GNUPG_Scdaemon_Error = 71,
101   GNUPG_Unsupported_Protocol = 72,
102 };
103
104 /* Status codes - fixme: should go into another file */
105 enum {
106   STATUS_ENTER,
107   STATUS_LEAVE,
108   STATUS_ABORT,
109   STATUS_GOODSIG,
110   STATUS_BADSIG,
111   STATUS_ERRSIG,
112   STATUS_BADARMOR,
113   STATUS_RSA_OR_IDEA,
114   STATUS_SIGEXPIRED,
115   STATUS_KEYREVOKED,
116   STATUS_TRUST_UNDEFINED,
117   STATUS_TRUST_NEVER,
118   STATUS_TRUST_MARGINAL,
119   STATUS_TRUST_FULLY,
120   STATUS_TRUST_ULTIMATE,
121   
122   STATUS_SHM_INFO,
123   STATUS_SHM_GET,
124   STATUS_SHM_GET_BOOL,
125   STATUS_SHM_GET_HIDDEN,
126   
127   STATUS_NEED_PASSPHRASE,
128   STATUS_VALIDSIG,
129   STATUS_SIG_ID,
130   STATUS_ENC_TO,
131   STATUS_NODATA,
132   STATUS_BAD_PASSPHRASE,
133   STATUS_NO_PUBKEY,
134   STATUS_NO_SECKEY,
135   STATUS_NEED_PASSPHRASE_SYM,
136   STATUS_DECRYPTION_FAILED,
137   STATUS_DECRYPTION_OKAY,
138   STATUS_MISSING_PASSPHRASE,
139   STATUS_GOOD_PASSPHRASE,
140   STATUS_GOODMDC,
141   STATUS_BADMDC,
142   STATUS_ERRMDC,
143   STATUS_IMPORTED,
144   STATUS_IMPORT_RES,
145   STATUS_FILE_START,
146   STATUS_FILE_DONE,
147   STATUS_FILE_ERROR,
148   
149   STATUS_BEGIN_DECRYPTION,
150   STATUS_END_DECRYPTION,
151   STATUS_BEGIN_ENCRYPTION,
152   STATUS_END_ENCRYPTION,
153   
154   STATUS_DELETE_PROBLEM,
155   STATUS_GET_BOOL,
156   STATUS_GET_LINE,
157   STATUS_GET_HIDDEN,
158   STATUS_GOT_IT,
159   STATUS_PROGRESS,
160   STATUS_SIG_CREATED,
161   STATUS_SESSION_KEY,
162   STATUS_NOTATION_NAME,
163   STATUS_NOTATION_DATA,
164   STATUS_POLICY_URL,
165   STATUS_BEGIN_STREAM,
166   STATUS_END_STREAM,
167   STATUS_KEY_CREATED,
168   STATUS_USERID_HIN,
169   STATUS_UNEXPECTED,
170   STATUS_INV_RECP,
171   STATUS_NO_RECP,
172   STATUS_ALREADY_SIGNED,
173 };
174
175
176 /*-- errors.c (built) --*/
177 const char *gnupg_strerror (int err);
178
179
180 #endif /*GNUPG_COMMON_ERRORS_H*/