aboutsummaryrefslogtreecommitdiffstats
path: root/g10/app-openpgp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * sign.c (hash_for): Add code to detect if the sk lives on a smartDavid Shaw2006-01-011-1/+5
| | | | | | | | | | | | card. If it does, only allow 160-bit hashes, a la DSA. This involves passing the *sk in, so change all callers. This is correct for today, given the current 160-bit q in DSA, and the current SHA-1/RIPEMD160 support in the openpgp card. It will almost certainly need changing down the road. * app-openpgp.c (do_sign): Give user error if hash algorithm is not supported by the card.
* (parse_signature): Use log_info for messagesWerner Koch2005-06-181-1/+1
| | | | | | | about missing timestamp or keyid. In case we don't use that key there won't be no further error and thus gpg does not need to return with an error.
* Updated FSF street address and preparations for a release candidate.Werner Koch2005-05-311-1/+2
|
* * passphrase.c (ask_passphrase): Unescape the description string.Werner Koch2005-05-241-2/+2
| | | | | | | * cardglue.c (unescape_status_string): Removed. Changed all caller to use ... * misc.c (unescape_percent_string): New.
* * app-openpgp.c, app-common.h: Again updated from gnupg 1.9 CVS.Werner Koch2005-05-231-212/+0
| | | | | | | * cardglue.c (open_card): Check USE_AGENT. (agent_scd_checkpin): Implemented Assuan part. (agent_scd_change_pin): Ditto.
* * cardglue.c (send_status_info): Make CTRL optional.Werner Koch2005-05-211-33/+318
| | | | | | | | | | | (agent_scd_writekey, inq_writekey_parms): New. (agent_openpgp_storekey): Removed. * cardglue.h: Add a few more error code mappings. * keygen.c (copy_mpi): Removed. (save_unprotected_key_to_card): Changed to use agent_scd_writekey. * app-common.h, app-openpgp.c, tlv.c, tlv.h: Updated from newer version in gnupg 1.9 CVS.
* (ccid_transceive): Arghhh. The seqno is anotherWerner Koch2005-05-201-73/+572
| | | | | | bit in the R-block than in the I block, this was wrong at one place. Fixes bug #419 and hopefully several others.
* * ccid-driver.c (ccid_slot_status): Fixed debug messages.Werner Koch2005-04-071-2/+43
| | | | | | | | | * card-util.c (card_edit): Add command "verify". Enhanced admin command to allow optional arguments "on", "off" and "verify". (card_status): Print private DOs in colon mode. * app-openpgp.c (do_check_pin): Add hack to allow verification of CHV3.
* (pin_cb): Print a warning if the info string hack isWerner Koch2005-03-301-1/+1
| | | | | not there. This may happen due to typos in the translation.
* (get_cached_data): New arg GET_IMMEDIATE to bypassWerner Koch2005-01-251-36/+33
| | | | | | | | | | | | | | | | the cache. Changed all callers. (get_one_do): Bypass the cache if the value would have been read directly for v1.1 cards.It makes things a bit slower but obnly for 1.0 cards and there are not that many cards out in the wild. This is required to fix a caching bug when generating new keys; as a side effect of the retrieval of the the C4 DO from the 6E DO the chaced fingerprint will get updated to the old value and later when signing the generated key the checking of the fingerprint fails becuase it won't match the new one. Thanks to Moritz for analyzing this problem. (verify_chv3): Removed the CHV status reread logic because we won't cache the C4 DO anymore.
* * app-openpgp.c (send_fprtime_if_not_null): New.Werner Koch2004-12-101-1/+28
| | | | | | | | (do_getattr): Add KEY_TIME. (do_learn_status): Print KEY_TIME. * cardglue.c (learn_status_cb): Parse KEY-TIME. * card-util.c (card_status): Print creation time if available.
* * passphrase.c (agent_get_passphrase): New args CUSTOM_PROMPT andWerner Koch2004-12-091-12/+44
| | | | | | | | | | | | | | | | | | | | | CUSTOM_DESCRIPTION. Changed all callers. * app-openpgp.c (do_getattr, do_learn_status, do_setattr): Support the new private DOs. (do_change_pin): Add a "N" prefix to the strings so that the callback can act accordingly for a new PIN. Unfortunately this breaks existing translations but I see no wother way to overvome this. * cardglue.c (learn_status_cb): Ditto. (agent_release_card_info): Ditto. (struct pin_cb_info_s): Removed and changed all users. (pin_cb): Reworked. * card-util.c (card_status): Print them (card_edit): New command PRIVATEDO. (change_private_do): New.
* (open_info_file): New.Werner Koch2004-11-171-18/+25
| | | | | | | | (main): Unconditionally implement --status-file, --logger-file, --attribute-file, --passphrase-file, --command-file. This is not generally useful but easy to support and might make scripting under Windows easier.
* (verify_chv3): The minimum length for CHV3 isWerner Koch2004-10-261-3/+3
| | | | | 8. Changed string to match the other ones.
* * options.h, g10.c (main), mainproc.c (check_sig_and_print): RenameDavid Shaw2004-10-211-1/+1
| | | | | | | | verify-option show-validity to show-uid-validity to match the similar list-option. * app-openpgp.c (verify_chv3): Fix typo.
* * configure.ac: Remove the check for asprintfWerner Koch2004-10-211-1/+6
| | | | | | | | | | | | | | | | * app-common.h (app_openpgp_storekey: Add prototype. * app-openpgp.c (do_sign): Replace asprintf by direct allocation. This avoids problems with missing vasprintf implementations. * card-util.c (generate_card_keys): Add a #warning for gnupg 1.9 and use the same string there. * util.h [!HAVE_VASPRINTF]: Removed prototype. * vasprintf.c: Removed. It was used only at one place and I don't want to get into build problems in 1.4.
* * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New.Werner Koch2004-10-151-32/+111
| | | | | | | | | | | | | (AUTOMAKE_OPTIONS): New. * configure.ac: Check whether vasprintf needs a replacement. * app-openpgp.c (parse_login_data): New. (app_select_openpgp): Call it. (do_setattr): Reparse it after change. * Makefile.am: Add ksutil.h.
* * mk-w32-dist: Updated from stable branch.Werner Koch2004-10-011-1/+1
| | | | | | | | * mk-gpg-texi: Changed to use the newer docbook2x-texi utility. * config.guess, config.sub, mkinstalldirs, missing * depcomp, install-sh: Upgraded.
* * card-util.c (card_edit): Take admin only status from the table.Werner Koch2004-09-271-19/+60
| | | | | | | | | | | | * app-openpgp.c: Made all strings translatable. (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin available for use in gnupg 2. (verify_chv3): Reimplemented countdown showing to use only functions from this module. Flush the CVH status cache on a successful read. (get_one_do): Hack to bypass the cache for cards versions > 1.0. (store_fpr): Store the creation date for card version > 1.0.
* We need to take care that several files are also used in gnupg 1.9 andWerner Koch2004-09-271-42/+60
| | | | | | | | | | | | | | there by the scdaemon which is a bit different to the direct integration in gpg 1.3. In general they should all be maintained in 1.9 but while preparing 1.4 its okay to do it in 1.3. We just need to take some care not to break 1.9 to heavily. app-openpgp.c: Made all strings translatable. (verify_chv3) [GNUPG_MAJOR_VERSION]: Make opt.allow_admin available for use in gnupg 2. (verify_chv3): Reimplemented countdown showing to use only functions from this module.
* * main.h, g10.c (main), card-util.c (change_pin): If "admin" has not beenDavid Shaw2004-09-251-8/+20
| | | | | | | | | | | | | | issued, skip right to the CHV1/CHV2 PIN change. No need to show the unblock or admin PIN change option. (card_edit): Add "admin" command to add admin commands to the menu. Do not allow admin commands until "admin" is given. * app-openpgp.c (verify_chv3): Show a countdown of how many wrong admin PINs can be entered before the card is locked. * options.h, g10.c (main), app-openpgp.c (verify_chv3): Remove --allow-admin.
* Note: I have not fully tested the new key creation due to a pc/scWerner Koch2004-09-231-39/+87
| | | | | | | | | | | | | | | | | | | error. However the backupfile has been created successfully. * rsa.c (rsa_generate): Return the dummy list of factors only if the caller asked for it. * card_util.c (generate_card_keys): ask whether backup should be created. (card_store_subkey): Factored some code out to .. * keygen.c (save_unprotected_key_to_card): .. new function. (gen_card_key_with_backup): New. (generate_raw_key): New. (generate_keypair): New arg BACKUP_ENCRYPTION_DIR. Changed all callers. (do_generate_keypair): Divert to gen_card_key_with_backup when desired.
* * gpg.sgml: Document "addcardkey" and "keytocard".Werner Koch2004-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | * apdu.c (open_pcsc_reader): Do not print empty reader string. * keygen.c (ask_algo): Allow creation of AUTH keys. * keyid.c (usagestr_from_pk): New. * app-openpgp.c (app_openpgp_storekey): Call flush_cache. * keyedit.c (keyedit_menu): New command "keytocard" (keyedit_menu): Bad hack for the not_with_sk element. (show_key_with_all_names): Print the usage. (find_pk_from_sknode): New. * card-util.c (card_store_subkey): New. (copy_mpi): New. * cardglue.c (agent_openpgp_storekey): New.
* * app-openpgp.c (get_cached_data): Avoid mallocing zero since it breaks usDavid Shaw2004-09-111-8/+12
| | | | | when using --enable-m-guard.
* * README: Doc --disable-card-support and --without-readline.Werner Koch2004-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * card-util.c (card_edit): Require PIN only for generate.Werner Koch2004-04-281-1/+5
| | | | | * app-openpgp.c (do_setattr): Sync FORCE_CHV1.
* A bunch of changes for the openpgp card.Werner Koch2004-04-271-134/+258
|
* * passphrase.c (ask_passphrase): Add optional promptid arg.Werner Koch2003-10-211-51/+86
| | | | | | | | | | | | | | | | | | | Changed all callers. * cardglue.c (pin_cb): Use it here, so the machine interface can tell whether the Admin PIN is requested. * cardglue.c (agent_scd_checkpin): New. * misc.c (openpgp_pk_algo_usage): Added AUTH usage. * app-openpgp.c (check_against_given_fingerprint): New. Factored out that code elsewhere. (do_check_pin): New. * card-util.c (card_edit): New command "passwd". Add logic to check the PIN in advance. (card_status): Add new args to return the serial number. Changed all callers.
* * cardglue.c (pin_cb): Detect whether an admin or regular PIN isWerner Koch2003-10-081-0/+25
| | | | | | | | | | | | | | | | | | | | requested. (genkey_status_cb): New. (agent_scd_genkey): Implemented. * keygen.c (generate_keypair): New arg CARD_SERIALNO and prepare parameters for on card key generation. Changed all callers. (do_generate_keypair): Add new arg card and merged casrd specific changes from 1.9. (proc_parameter_file): New arg card, apss it down to do_generate_keypair and changed all callers. (gen_card_key): New. * g10.c: Include cardclue.h. (main): s/app_set_default_reader_port/card_set_reader_port/. * cardglue.c (card_set_reader_port): New to address include file issues.
* * cardglue.c (learn_status_cb): Release values before assignmentWerner Koch2003-10-021-241/+263
| | | | | | | | | so that it can be used by getattr to update the structure. (agent_scd_getattr): New. * keylist.c (print_pubkey_info): Add FP arg for optional printing to a stream. Changed all callers.
* * g10.c (main): New commands --card-edit, --card-status andWerner Koch2003-09-281-0/+1430
--change-pin. New options --ctapi-driver, --pcsc-driver and --disable-ccid * options.h (DBG_CARD_IO): New. * cardglue.c, cardclue.h: Enhanced. * card-util.c: New. Taken from current the gnupg 1.9 branch. * app-common.h, app-openpgp.c, iso7816.c, iso7816.h, apdu.c * apdu.h, ccid-driver.c, ccid-driver.h: New. Takem from the current gnupg 1.9 branch withy minor changes to include directives. * Makefile.am: Added these files.