Better reset the PIN verification stati after changing the key attributes.
[gnupg.git] / g10 / gpg.h
blobb53303e1390f785f60f30f7386f65ffea843b7da
1 /* gpg.h - top level include file for gpg etc.
2 * Copyright (C) 2003, 2006 Free Software Foundation, Inc.
4 * This file is part of GnuPG.
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 3 of the License, or
9 * (at your option) any later version.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef GNUPG_G10_GPG_H
20 #define GNUPG_G10_GPG_H
22 /* Note, that this file should be the first one after the system
23 header files. This is required to set the error source to the
24 correct value and may be of advantage if we ever have to do
25 special things. */
27 #ifdef GPG_ERR_SOURCE_DEFAULT
28 #error GPG_ERR_SOURCE_DEFAULT already defined
29 #endif
30 #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GPG
31 #define map_assuan_err(a) \
32 map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
33 #include <gpg-error.h>
34 #include <gcrypt.h>
37 /* Number of bits we accept when reading or writing MPIs. */
38 #define MAX_EXTERN_MPI_BITS 16384
40 /* The maximum length of a binary fingerprints. */
41 #define MAX_FINGERPRINT_LEN 20
44 /*
45 Forward declarations.
48 /* Object used to keep state locally to server.c . */
49 struct server_local_s;
51 /* Object used to describe a keyblok node. */
52 typedef struct kbnode_struct *KBNODE;
53 /* Object used for looking ob keys. */
54 typedef struct keydb_search_desc KEYDB_SEARCH_DESC;
58 /* Session control object. This object is passed to most functions to
59 convey the status of a session. Note that the defaults are set by
60 gpg_init_default_ctrl(). */
61 struct server_control_s
63 struct server_local_s *server_local;
70 /*
71 Compatibility stuff to be faded out over time.
74 /* Simple wrappers. */
75 #define g10_errstr(a) gpg_strerror ((a))
78 /* Mapping of the old error codes to the gpg-error ones. Fixme: This
79 is just a temporary solution: We need to do all these gpg_error()
80 calls in the code. */
81 #define G10ERR_BAD_KEY GPG_ERR_BAD_KEY
82 #define G10ERR_BAD_PASS GPG_ERR_BAD_PASS
83 #define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY
84 #define G10ERR_BAD_SIGN GPG_ERR_BAD_SIGNATURE
85 #define G10ERR_BAD_URI GPG_ERR_BAD_URI
86 #define G10ERR_CHECKSUM GPG_ERR_CHECKSUM
87 #define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO
88 #define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE
89 #define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO
90 #define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE
91 #define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO
92 #define G10ERR_FILE_EXISTS GPG_ERR_EEXIST
93 #define G10ERR_GENERAL GPG_ERR_GENERAL
94 #define G10ERR_INV_ARG GPG_ERR_INV_ARG
95 #define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING
96 #define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID
97 #define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR
98 #define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET
99 #define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN
100 #define G10ERR_KEYSERVER GPG_ERR_KEYSERVER
101 #define G10ERR_NO_DATA GPG_ERR_NO_DATA
102 #define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY
103 #define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY
104 #define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID
105 #define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED
106 #define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE
107 #define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE
108 #define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO
109 #define G10ERR_READ_FILE GPG_ERR_READ_FILE
110 #define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE
111 #define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT
112 #define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS
113 #define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT
114 #define G10ERR_TRUSTDB GPG_ERR_TRUSTDB
115 #define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED
116 #define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET
117 #define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED
118 #define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY
119 #define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY
120 #define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY
123 #endif /*GNUPG_G10_GPG_H*/