aboutsummaryrefslogtreecommitdiffstats
path: root/g10/card-util.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2005-10-18Fixed minor card related bugs and enhanced status messagesWerner Koch1-16/+17
2005-09-07Add "help" sub option to --*-options.Werner Koch1-0/+1
2005-07-27Converted all m_free to xfree etc.Werner Koch1-1/+1
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2005-05-03* passphrase.c (agent_get_passphrase): Add new arg CACHEID.Werner Koch1-0/+4
Changed all callers. (ask_passphrase): Add new arg CACHEID and use it in agent mode. Changed all callers. (passphrase_clear_cache): New arg CACHEID. Changed all callers. * cardglue.c (format_cacheid): New. (pin_cb): Compute a cache ID. (agent_scd_pksign, agent_scd_pkdecrypt): Use it. (agent_clear_pin_cache): New. * card-util.c (change_pin): Clear the PIN cache. (check_pin_for_key_operation): Ditto.
2005-04-07* ccid-driver.c (ccid_slot_status): Fixed debug messages.Werner Koch1-2/+35
* 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.
2005-03-21* keyedit.c (command_generator, keyedit_completion): ChangedWerner Koch1-9/+16
indentation. * card-util.c (command_generator, card_edit_completion): Ditto.
2005-03-20* card-util.c (command_generator, card_edit_completion)David Shaw1-14/+69
[GNUPG_MAJOR_VERSION==1 && HAVE_LIBREADLINE]: New functions to enable command completion in the --card-edit menu. (card_edit): Call them here.
2005-03-14* card-util.c (card_status): Use isotimestamp and not theWerner Koch1-3/+3
localized asctimestamp to match the timezone used in the key information. * miscutil.c (isotimestamp): New.
2005-03-14* cardglue.c (pin_cb): Disable debug output.Werner Koch1-1/+1
* mk-w32-dist: Check for patch files. * w32installer.nsi: Translated a few more strings. Print a warning if permssions are not suitable for the installation. Add Uninstaller entries.
2005-03-07* primegen.c (is_prime): Free A2. Noted by [email protected].Werner Koch1-6/+17
Fixes #423. * DETAILS: Document new status codes. * cardglue.c (agent_scd_pkdecrypt, agent_scd_pksign) (agent_scd_genkey, agent_scd_setattr, agent_scd_change_pin) (agent_scd_checkpin, agent_openpgp_storekey): Make sure to send a SC_OP_FAILURE after card operations which might change data. * card-util.c (change_pin): Send a SC_OP_SUCCESS after a PIN has been changed. (change_name): Removed a debug output. * status.h, status.c: New codes BAD_PASSPHRASE_PIN, SC_OP_FAILURE and SC_OP_SUCCESS. * de.po: Updated. Translation is still in the works, though.
2005-02-16* card-util.c (fetch_url): Fetch the key from the defaultWerner Koch1-4/+9
keyserver if no URL is available. * w32installer.nsi: Added page to select the language. * mk-w32-dist: Create the opt.ini using the available languages.
2005-02-15* gpg.sgml: Add bkuptocard command for --edit-key.Werner Koch1-3/+4
* passphrase.c (agent_get_passphrase): Don't call free_public_key if PK is NULL. (passphrase_clear_cache): Ditto. Removed debug output. (passphrase_to_dek): Ditto.
2005-01-20* gpgv.c (tty_fprintf): New stub.Werner Koch1-4/+31
* card-util.c (card_status): Create asecret key stub on the fly and print more information about a card key. * import.c (pub_to_sec_keyblock, auto_create_card_key_stub): New. * getkey.c (get_seckeyblock_byfprint): New. * keylist.c (print_card_key_info): New.
2004-12-14Prepared for last 1.4 release candidateWerner Koch1-22/+19
2004-12-10* app-openpgp.c (send_fprtime_if_not_null): New.Werner Koch1-1/+12
(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.
2004-12-09* passphrase.c (agent_get_passphrase): New args CUSTOM_PROMPT andWerner Koch1-1/+88
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.
2004-10-28* card-util.c, delkey.c, keygen.c, plaintext.c, keyedit.c, passphrase.c,David Shaw1-2/+2
revoke.c: Collapse the two different "can't do that in batch mode" strings into one.
2004-10-28* keylist.c (status_one_subpacket): New. Send the subpacket data to theDavid Shaw1-0/+4
--status interface. * card-util.c (card_edit): Show when admin is enabled or not. * status.h, status.c: New STATUS_SIG_SUBPACKET type. * build-packet.c (build_sig_subpkt): Multiple keyserver URLs are allowed.
2004-10-26(agent_send_all_options): Try to deduce the ttynameWerner Koch1-3/+23
from stdin.
2004-10-22Compile fixes.Werner Koch1-5/+25
2004-10-22Updated from 1.3Werner Koch1-130/+489
2004-10-21* configure.ac: Remove the check for asprintfWerner Koch1-3/+3
* 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.
2004-10-13Added SELInux hacks and did some cleanups.Werner Koch1-2/+9
2004-10-11* pkclist.c (do_edit_ownertrust): Use the same translated string forDavid Shaw1-1/+1
showing the user ID as mainproc.c:print_pkenc_list. * mainproc.c (print_pkenc_list): Allow translating the quotes around the user ID. * card-util.c, g10.c, photoid.c, trustdb.c: The last of the \"%s\" -> `%s' quoting for things that aren't user IDs. * keyserver.c (keyserver_spawn): If there is no keyserver host, print the whole URI since it is self-contained.
2004-10-10* card-util.c, keyedit.c, openfile.c, pkclist.c, delkey.c, keygen.c,David Shaw1-3/+15
photoid.c, revoke.c: Some yes-or-no prompts end in "(y/n)". Some don't. Consistently use y/n everywhere.
2004-09-27* card-util.c (card_edit): Take admin only status from the table.Werner Koch1-33/+27
* 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.
2004-09-25* main.h, g10.c (main), card-util.c (change_pin): If "admin" has not beenDavid Shaw1-74/+106
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.
2004-09-23Note: I have not fully tested the new key creation due to a pc/scWerner Koch1-127/+8
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.
2004-09-23* gpg.sgml: Document "addcardkey" and "keytocard".Werner Koch1-104/+374
* 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.
2004-09-20* gpg.sgml: Document -K.Werner Koch1-0/+114
* g10.c: Make -K an alias for --list-secret-keys. * keylist.c (print_card_serialno): New. Taken from gnupg 1.9.11. (list_keyblock_print): Make use of it. * keyedit.c (show_key_with_all_names): Print the card S/N. * keyedit.c (keyedit_menu): New command ADDCARDKEY. * card-util.c (card_generate_subkey): New. * keygen.c (generate_card_subkeypair): New. (gen_card_key): New arg IS_PRIMARY; changed all callers. * cardglue.c (open_card): Use shutdown code if possible. (check_card_serialno): Ditto.
2004-09-11* card-util.c (fetch_url, card_edit): Use the pubkey URL stored on theDavid Shaw1-1/+50
card to fetch an updated copy. Works with either straight URLs or HKP or LDAP keyservers. * keyserver-internal.h, keyserver.c (keyserver_import_fprint), import.c (revocation_present): Use a keyserver_spec so the caller can pass in whatever keyserver they like.
2004-09-09* README: Doc --disable-card-support and --without-readline.Werner Koch1-11/+112
* 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-07-01* card-util.c (change_login): Kludge to allow reading data from aWerner Koch1-11/+112
file. (card_edit): Pass ARG_STRING to change_login. (card_status): Print CA fingerprints. (change_cafpr): New. (card_edit): New command CAFPR. * call-agent.h: Add members for CA fingerprints. * call-agent.c (agent_release_card_info): Invalid them. (learn_status_cb): Store them.
2004-04-29* card-util.c (card_edit): Remove PIN verification.Werner Koch1-32/+26
(generate_card_keys): New arg SERIALNO. Do PIN verification here after resetting forced_chv1.
2004-04-28* card-util.c (card_edit): Require PIN only for generate.Werner Koch1-32/+26
* app-openpgp.c (do_setattr): Sync FORCE_CHV1.
2004-04-27A bunch of changes for the openpgp card.Werner Koch1-3/+26
2004-04-26(change_name): Check that the NAME is not too long.Werner Koch1-0/+24
(change_url): Likewise. (change_login): Likewise.
2003-12-17* card-util.c (print_name): Fixed bad format string usage.Werner Koch1-3/+2
(print_isoname): Ditto. * trustdb.c (check_regexp): s/exp/expr/. * keyedit.c (trustsig_prompt): Removed a "> 255" term; it is always false due to the data type. * passphrase.c (agent_get_passphrase): Use xasprintf and avoid non-literal format strings. * tdbio.c (upd_hashtable, drop_from_hashtable, lookup_hashtable): Fixed log_error format string bugs. Kudos to the now working gcc-3.3 -Wformat-nonliteral and Florian Weimer's investigations in gnupg 1.2.3.
2003-10-21* passphrase.c (ask_passphrase): Add optional promptid arg.Werner Koch1-19/+55
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.
2003-10-21* card-util.c (card_edit): New command "passwd". Add logic toWerner Koch1-19/+55
check the PIN in advance. (card_status): Add new args to return the serial number. Changed all callers. * call-agent.c (agent_scd_checkpin): New.
2003-10-08* cardglue.c (pin_cb): Detect whether an admin or regular PIN isWerner Koch1-1/+87
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.
2003-10-08* call-agent.c (agent_scd_getattr): Don't clear the passed infoWerner Koch1-1/+87
structure, so that it can indeed be updated. * card-util.c (fpr_is_zero): New. (generate_card_keys): New. (card_edit): New command "generate". * keygen.c (generate_keypair): New arg CARD_SERIALNO, removed call to check_smartcard. (check_smartcard,show_smartcard): Removed. (show_sha1_fpr,fpr_is_zero): Removed. * app-openpgp.c (do_getattr): Support SERIALNO and AID.
2003-10-02Fixes to make inclusion of card raleted source files into 1.3 easier.Werner Koch1-0/+6
2003-10-02* cardglue.c (learn_status_cb): Release values before assignmentWerner Koch1-41/+66
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.
2003-09-30* keylist.c (print_card_serialno): New.Werner Koch1-27/+54
(list_keyblock_print): Use it here. * card-util.c (toggle_forcesig): New. (card_edit): New command "forcesig". * card-util.c (print_name, print_isoname): Use 0 and not LF fro the max_n arg of tty_print_utf8_string2. * call-agent.c (agent_scd_getattr): New. (learn_status_cb): Release values before assignment so that it can be used by getattr to update the structure. * card-util.c (change_pin): Simplified. We now have only a PIN and an Admin PIN.
2003-09-28* g10.c (main): New commands --card-edit, --card-status andWerner Koch1-0/+720
--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.
2003-09-262003-09-26 Timo Schulz <[email protected]>Timo Schulz1-1/+1
* card_status (card_status): Do not use fputs since the fp parameter can be NULL. This fixes a segv.
2003-09-24(print_isoname,card_status): Handle opt.with_colons.Werner Koch1-49/+149
(print_sha1_fpr_colon): New.
2003-09-222003-09-22 Timo Schulz <[email protected]>Timo Schulz1-0/+3
* card-util.c (card_status): Free pk in case of an error and return if the card is no OpenPGP card.