2002-06-29 15:31:13 +02:00
|
|
|
/* errors.h - erro code
|
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
1997-11-18 15:06:00 +01:00
|
|
|
*
|
1998-06-16 17:13:28 +02:00
|
|
|
* This file is part of GNUPG.
|
1997-11-18 15:06:00 +01:00
|
|
|
*
|
1998-06-16 17:13:28 +02:00
|
|
|
* GNUPG is free software; you can redistribute it and/or modify
|
1997-11-18 15:06:00 +01:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
1998-06-16 17:13:28 +02:00
|
|
|
* GNUPG is distributed in the hope that it will be useful,
|
1997-11-18 15:06:00 +01:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
|
|
*/
|
2002-06-29 15:31:13 +02:00
|
|
|
#ifndef G10_ERRORS_H
|
|
|
|
#define G10_ERRORS_H
|
1997-11-18 15:06:00 +01:00
|
|
|
|
2002-06-29 15:31:13 +02:00
|
|
|
#define G10ERR_GENERAL 1
|
|
|
|
#define G10ERR_UNKNOWN_PACKET 2
|
|
|
|
#define G10ERR_UNKNOWN_VERSION 3 /* Unknown version (in packet) */
|
|
|
|
#define G10ERR_PUBKEY_ALGO 4 /* Unknown pubkey algorithm */
|
|
|
|
#define G10ERR_DIGEST_ALGO 5 /* Unknown digest algorithm */
|
|
|
|
#define G10ERR_BAD_PUBKEY 6 /* Bad public key */
|
|
|
|
#define G10ERR_BAD_SECKEY 7 /* Bad secret key */
|
|
|
|
#define G10ERR_BAD_SIGN 8 /* Bad signature */
|
|
|
|
#define G10ERR_NO_PUBKEY 9 /* public key not found */
|
|
|
|
#define G10ERR_CHECKSUM 10 /* checksum error */
|
|
|
|
#define G10ERR_BAD_PASS 11 /* Bad passphrase */
|
|
|
|
#define G10ERR_CIPHER_ALGO 12 /* Unknown cipher algorithm */
|
|
|
|
#define G10ERR_KEYRING_OPEN 13
|
|
|
|
#define G10ERR_INVALID_PACKET 14
|
|
|
|
#define G10ERR_INVALID_ARMOR 15
|
|
|
|
#define G10ERR_NO_USER_ID 16
|
|
|
|
#define G10ERR_NO_SECKEY 17 /* secret key not available */
|
|
|
|
#define G10ERR_WRONG_SECKEY 18 /* wrong seckey used */
|
|
|
|
#define G10ERR_UNSUPPORTED 19
|
|
|
|
#define G10ERR_BAD_KEY 20 /* bad (session) key */
|
|
|
|
#define G10ERR_READ_FILE 21
|
|
|
|
#define G10ERR_WRITE_FILE 22
|
|
|
|
#define G10ERR_COMPR_ALGO 23 /* Unknown compress algorithm */
|
|
|
|
#define G10ERR_OPEN_FILE 24
|
|
|
|
#define G10ERR_CREATE_FILE 25
|
|
|
|
#define G10ERR_PASSPHRASE 26 /* invalid passphrase */
|
|
|
|
#define G10ERR_NI_PUBKEY 27
|
|
|
|
#define G10ERR_NI_CIPHER 28
|
|
|
|
#define G10ERR_SIG_CLASS 29
|
|
|
|
#define G10ERR_BAD_MPI 30
|
|
|
|
#define G10ERR_RESOURCE_LIMIT 31
|
|
|
|
#define G10ERR_INV_KEYRING 32
|
|
|
|
#define G10ERR_TRUSTDB 33 /* a problem with the trustdb */
|
|
|
|
#define G10ERR_BAD_CERT 34 /* bad certicate */
|
|
|
|
#define G10ERR_INV_USER_ID 35
|
|
|
|
#define G10ERR_CLOSE_FILE 36
|
|
|
|
#define G10ERR_RENAME_FILE 37
|
|
|
|
#define G10ERR_DELETE_FILE 38
|
|
|
|
#define G10ERR_UNEXPECTED 39
|
|
|
|
#define G10ERR_TIME_CONFLICT 40
|
|
|
|
#define G10ERR_WR_PUBKEY_ALGO 41 /* unusabe pubkey algo */
|
|
|
|
#define G10ERR_FILE_EXISTS 42
|
|
|
|
#define G10ERR_WEAK_KEY 43 /* NOTE: hardcoded into the cipher modules */
|
|
|
|
#define G10ERR_WRONG_KEYLEN 44 /* NOTE: hardcoded into the cipher modules */
|
|
|
|
#define G10ERR_INV_ARG 45
|
|
|
|
#define G10ERR_BAD_URI 46 /* syntax error in URI */
|
|
|
|
#define G10ERR_INVALID_URI 47 /* e.g. unsupported scheme */
|
|
|
|
#define G10ERR_NETWORK 48 /* general network error */
|
|
|
|
#define G10ERR_UNKNOWN_HOST 49
|
|
|
|
#define G10ERR_SELFTEST_FAILED 50
|
|
|
|
#define G10ERR_NOT_ENCRYPTED 51
|
|
|
|
#define G10ERR_NOT_PROCESSED 52
|
|
|
|
#define G10ERR_UNU_PUBKEY 53
|
|
|
|
#define G10ERR_UNU_SECKEY 54
|
|
|
|
#define G10ERR_KEYSERVER 55
|
* README: Doc --disable-card-support and --without-readline.
* configure.ac: Check for readline. Make enable-card-support the
default. New option --without-readline. Allow the use of either
the development or the stable libusb.
* cardglue.h: Add members for CA fingerprints.
* cardglue.c (agent_release_card_info): Invalid them.
(learn_status_cb): Store them.
* app-common.h, app-openpgp.c, iso7816.c, iso7816.h
* apdu.c, apdu.h, ccid-driver.c, ccid-driver.h
* card-util.c: Updated from current gnupg-1.9.
* ccid-driver.h (CCID_DRIVER_ERR_ABORTED): New.
* ccid-driver.c (ccid_open_reader): Support the stable 0.1 version
of libusb.
(ccid_get_atr): Handle short messages.
* apdu.c (my_rapdu_get_status): Implemented.
* apdu.c: Include <signal.h>.
* apdu.c (reader_table_s): Add function pointers for the backends.
(apdu_close_reader, apdu_get_status, apdu_activate)
(send_apdu): Make use of them.
(new_reader_slot): Intialize them to NULL.
(dump_ccid_reader_status, ct_dump_reader_status): New.
(dump_pcsc_reader_status): New.
(open_ct_reader, open_pcsc_reader, open_ccid_reader)
(open_osc_reader, open_rapdu_reader): Intialize function pointers.
(ct_activate_card, ct_send_apdu, pcsc_send_apdu, osc_send_apdu)
(error_string): Removed. Replaced by apdu_strerror.
(get_ccid_error_string): Removed.
(ct_activate_card): Remove the unused loop.
(reset_ct_reader): Implemented.
(ct_send_apdu): Activate the card if not yet done.
(pcsc_send_apdu): Ditto.
* ccid-driver.h: Add error codes.
* ccid-driver.c: Implement more or less proper error codes all
over the place.
* apdu.c (apdu_send_direct): New.
(get_ccid_error_string): Add some error code mappings.
(send_apdu): Pass error codes along for drivers already supporting
them.
(host_sw_string): New.
(get_ccid_error_string): Use above.
(send_apdu_ccid): Reset the reader if it has not yet been done.
(open_ccid_reader): Don't care if the ATR can't be read.
(apdu_activate_card): New.
(apdu_strerror): New.
(dump_reader_status): Only enable it with opt.VERBOSE.
* iso7816.c (map_sw): Add mappings for the new error codes.
* apdu.c (open_ct_reader, open_pcsc_reader, open_ccid_reader)
(reset_ccid_reader, open_osc_reader): Call dump_reader_status only
in verbose mode.
* app-openpgp.c (do_getattr): Fix for sending CA-FPR.
* app-openpgp.c (app_openpgp_readkey): Fixed check for valid
exponent.
* app-openpgp.c (do_setattr): Sync FORCE_CHV1.
* card-util.c (change_login): Kludge to allow reading data from a
file.
(card_edit): Pass ARG_STRING to change_login.
(card_status): Print CA fingerprints.
(change_cafpr): New.
(card_edit): New command CAFPR.
* errors.h (G10ERR_NO_CARD, G10ERR_CANCELED): New error codes.
* errors.c (g10_errstr): New error codes G10ERR_NO_CARD,
G10ERR_CANCELED.
2004-09-09 20:18:36 +02:00
|
|
|
#define G10ERR_CANCELED 56
|
|
|
|
#define G10ERR_NO_CARD 57
|
1998-05-13 19:53:36 +02:00
|
|
|
|
|
|
|
#ifndef HAVE_STRERROR
|
2004-11-03 21:03:46 +01:00
|
|
|
char *strerror (int n);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
const char * w32_strerror (int w32_errno);
|
1998-05-13 19:53:36 +02:00
|
|
|
#endif
|
|
|
|
|
2002-06-29 15:31:13 +02:00
|
|
|
#endif /*G10_ERRORS_H*/
|