aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * po: Update Japanese Translation.NIIBE Yutaka2019-06-261-4/+4
| | | | | | | | | | | | | | | | | | -- Thanks to Philippe. Reported-by: Phillppe Antoine Signed-off-by: NIIBE Yutaka <[email protected]>
| * scd: Do not conflict if a card with another serialno is demanded.Werner Koch2019-06-253-10/+26
| | | | | | | | | | | | | | | | | | * scd/app.c (check_application_conflict): Add args to pass a serialno. * scd/command.c (open_card_with_request): Pass the serialno to check_application_conflict. -- Signed-off-by: Werner Koch <[email protected]>
| * scd: Return a stable list with "getinfo card_list".Werner Koch2019-06-253-6/+39
| | | | | | | | | | | | | | | | | | | | | | * scd/app.c (compare_card_list_items): New. (app_send_card_list): Sort the card objects by slot. -- This is required so that in gpg-card a "list N" command always returns the expected card. Sorting by slot should be sufficient. Signed-off-by: Werner Koch <[email protected]>
| * scd: Add an re-select mechanism to switch apps.Werner Koch2019-06-2511-49/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-common.h (struct app_ctx_s): Add func ptr 'reselect'. * scd/app-piv.c (do_reselect): New. (app_select_piv): Move AID constant to file scope. * scd/app-openpgp.c (do_reselect): New. (app_select_openpgp): Move AID constant to file scope. * scd/app.c (apptype_from_name): New. (check_application_conflict): Check against all apps of the card. Always set current_apptype. (select_additional_application): New. (maybe_switch_app): New. (app_write_learn_status, app_readcert, app_readkey, app_getattr) (app_setattr, app_sign, app_auth, app_decipher, app_writecert) (app_writekey, app_genkey, app_change_pin, app_check_pin): Use it here. (app_do_with_keygrip): Force reselect on success. (app_new_register): Move setting of CURRENT_APPTYPE to ... (select_application): here so that it will be set to the requested card. * scd/command.c (open_card_with_request): Select additional application if possible. -- Noet that we will likely need to rework this even more so to get well defined semantics for card access. Signed-off-by: Werner Koch <[email protected]>
| * spelling: Fix "synchronize"Daniel Kahn Gillmor2019-06-243-4/+4
| | | | | | | | Signed-off-by: Daniel Kahn Gillmor <[email protected]>
| * scd: Take the card look while running app->with_keygrip.Werner Koch2019-06-211-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | * scd/app.c (app_do_with_keygrip): Lock the card. -- Better safe than sorry. We should also review the card reference counting to see whether we better ref the returned card object already here. Signed-off-by: Werner Koch <[email protected]>
| * scd: Take the lock earlier in the function dispatchers.Werner Koch2019-06-211-113/+154
| | | | | | | | | | | | | | | | | | | | | | | | * scd/app.c: Chnage all function dispatcher. -- This change will allow us to easier integrate an app swithcing logic. The change should have no user visible effect. The error checking we do now with the card locked will rarely be asserted. It is the correct thing to do anyway. Signed-off-by: Werner Koch <[email protected]>
| * scd: Add code to check whether app switching is possible.Werner Koch2019-06-213-20/+34
| | | | | | | | | | | | | | | | | | | | | | * scd/app.c (check_conflict): Fold into ... (check_application_conflict): this and adjust callers. Return a different error code if it is possible to switch apps. -- Right now this change does nothing visible. Signed-off-by: Werner Koch <[email protected]>
| * scd: Track the currently selected app.Werner Koch2019-06-213-3/+29
| | | | | | | | | | | | | | | | | | | | * scd/scdaemon.h (struct server_control_s): Add 'current_apptype'. * scd/command.c (scd_clear_current_app): New. * scd/app.c (app_new_register): Set it. (deallocate_card): Clear it. -- Signed-off-by: Werner Koch <[email protected]>
| * scd: Simplify inclusion of app-common.h.Werner Koch2019-06-2113-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/scdaemon.h: Include app-common.h. Remove inclusion of that header from all other files. (card_t, app_t): Move typedef to ... * scd/app-common.h: here. Use them in the defs. -- In another patch we will need apptype_t in the ctrl object and thus we need to reorganize things a bit now. Given that most files need app-common anyway it makes sense to always include it. Signed-off-by: Werner Koch <[email protected]>
| * gpg: Very minor code cleanup.Werner Koch2019-06-211-2/+2
| | | | | | | | | | | | * g10/decrypt-data.c (decrypt_data): Remove superfluous test. Signed-off-by: Werner Koch <[email protected]>
| * scd: Use enums for cardtype and apptype.Werner Koch2019-06-219-35/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-common.h (cardtype_t): New. (apptype_t): New. (struct card_ctx_s): Change type of cardtype. (struct app_ctx_s): Change type of apptype. Adjust all users. * scd/app.c (struct app_priority_list_s): Add field apptype. (strcardtype): New. Use as needed. (strapptype): New. Use as needed. -- Using strcmp is lame and we can't use a switch to let the compiler complain about missed cases. Signed-off-by: Werner Koch <[email protected]>
| * po: Update Japanese Translation.NIIBE Yutaka2019-06-201-57/+74
| | | | | | | | Signed-off-by: NIIBE Yutaka <[email protected]>
| * tools: Fix error handling for gpg-pair-tool.NIIBE Yutaka2019-06-201-1/+1
| | | | | | | | | | | | * tools/gpg-pair-tool.c (read_message): Initialize ERR. Signed-off-by: NIIBE Yutaka <[email protected]>
| * scd: Split data structures into app and card related objects.Werner Koch2019-06-1911-614/+771
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-common.h (struct card_ctx_s): New. (struct app_ctx_s): Factor card specific fields out to card_ctx_s. (app_get_slot): New. * scd/scdaemon.h (card_t): New. (struct server_control_s): Rename field app_ctx to card_ctx and change all users. * scd/app-dinsig.c: Use app_get_slot and adjust for chang in card related fields. * scd/app-geldkarte.c: Ditto. * scd/app-nks.c: Ditto. * scd/app-openpgp.c: Ditto. * scd/app-p15.c: Ditto. * scd/app-sc-hsm.c: Ditto. * scd/app.c: Lost of changes to adjust for the changed data structures. Change all callers. (app_list_lock): Rename to card_list_lock. (app_top): Remove. (card_top): New. (lock_app): Rename to lock_card and change arg type. (unlock_app): Rename to unlock_card. (app_dump_state): Print card and app info. (app_reset): Rename to card_reset. (app_new_register): Change for the new data structure. (deallocate_card): Dealloc card and all apps. (app_ref): Rename to card_ref. (app_unref): Rename to card_unref. (app_unref_locked): Rename to card_unref_locked. (card_get_serialno): New. * scd/command.c (cmd_pkdecrypt): Actually use the looked up card and former app object and not the standard one from the context. -- Although quite large, this is a straightforward change to separate card/token related data from card application related data. Before this change there was a one-to-one relation between card and application and no way to represent several applications on a card. The new data structure will allow for such a representation. Signed-off-by: Werner Koch <[email protected]>
| * scd: KEYINFO: Send LF for --data.NIIBE Yutaka2019-06-181-2/+4
| | | | | | | | | | | | | | | | | | * scd/command.c (send_keyinfo): Send LF for --data. -- Fixes-commit: 01730529f20882cd98882a61408e9bee960c86f1 Signed-off-by: NIIBE Yutaka <[email protected]>
| * scd:piv: Add the do_with_keygrip feature.Werner Koch2019-06-172-0/+95
| | | | | | | | | | | | | | * scd/app-piv.c (do_with_keygrip): New. (app_select_piv): Register function. Signed-off-by: Werner Koch <[email protected]>
| * scd: Add explict functions for 'app' reference counting.Werner Koch2019-06-174-23/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app.c (app_ref): New. (app_unref): New. (release_application): Renamed to ... (app_unref_locked): this and remove arg locked_already. Change callers to use this or app_ref. * scd/command.c (open_card_with_request): (cmd_pksign, cmd_pkauth, cmd_pkdecrypt): Use app_ref and app_unref instead of accessing the counter directly. -- This is better in case we need to debug stuff. There is a real change however: We now lock and unlock the app before changing the reference count. The whole app locking business should be reviewed because we pass pointers along without immediately bumping the refcount. Signed-off-by: Werner Koch <[email protected]>
| * scd: Slight change to app->fnc.do_with_keygrip.Werner Koch2019-06-173-13/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (do_with_keygrip): Return a real error code to avoid misinterpretation of the result. Also fix the case for a too small buffer. -- The only real chnage is the case for a too small buffer. That should in general never happen but if so we now return an error instead of success. Signed-off-by: Werner Koch <[email protected]>
| * scd: Use the correct gpg for the v1.0 OpenPGP card hack.Werner Koch2019-06-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | * scd/app-openpgp.c (get_public_key): Use gnupg_module_name instead of just "gpg". -- There is no bug report regarding this and it would be very unlikely but we should always use the gpg belonging to our code. Signed-off-by: Werner Koch <[email protected]>
| * note: previous commit 6e46862 fixes another minor doc issue fix.Werner Koch2019-06-170-0/+0
| | | | | | | | | | | | | | | | -- Please use useful subjects so that there is no need to lookup what a fix is. A commit fix should be indicated with the keyword "Fixes-commit: xxxxx"
| * fix up 6562de7475b21cd03c7b1a83a591fa563c589f5bDaniel Kahn Gillmor2019-06-141-1/+1
| | | | | | | | Signed-off-by: Daniel Kahn Gillmor <[email protected]>
| * doc/gpgsm: explain what "policy-file" refers to.Daniel Kahn Gillmor2019-06-111-1/+2
| | | | | | | | | | | | | | | | | | | | A new user who sees "policy-file" and searches naively through the documentation to find it again won't be able to tell what this refers to, since "policies.txt" doesn't otherwise match the search string "policy". This gives them a fighting chance at finding the documentation. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
| * gpgparsemail: Die on parse error, printing errno thing.NIIBE Yutaka2019-06-072-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpgparsemail.c (parse_message): Revert the change. * tools/rfc822parse.c (transition_to_body): Set ERRNO. (transition_to_header, insert_header): Likewise. -- In the comment of rfc822parse_* functions, it explicitly explained setting ERRNO on error. For parser errors, it may not have appropriate ERRNO, in such a case, use ENOENT. Fixes-commit: c13e459ffeffb8c5387c44b3c04bb92b7111a75b Signed-off-by: NIIBE Yutaka <[email protected]>
| * scd: Bring back --card-timeout option as deprecated.NIIBE Yutaka2019-06-062-0/+11
| | | | | | | | | | | | | | | | | | | | | | * doc/scdaemon.texi (card-timeout): Add. * scd/scdaemon.c (main): Revert the change. -- GnuPG-bug-id: 3383 Fixes-commit: 4262933ef6f7530b4ad55646250a6763de9bf103 Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpgparsemail: Die on parse error (not abort).NIIBE Yutaka2019-06-062-6/+12
| | | | | | | | | | | | | | | | | | | | | | * tools/gpgparsemail.c (parse_message): Don't use ERRNO. * tools/rfc822parse.c (transition_to_body): Return -1. (transition_to_header, insert_header): Likewise. -- GnuPG-bug-id: 1977 Signed-off-by: NIIBE Yutaka <[email protected]>
| * sm: Print a better diagnostic for encryption certificate selection.Werner Koch2019-06-041-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sm/certlist.c (gpgsm_add_to_certlist): Add diagnostic and fold two similar branches. -- Without this patch gpgsm printed: gpgsm[23045]: DBG: chan_6 <- RECIPIENT [email protected] gpgsm[23045]: certificate is not usable for encryption gpgsm[23045]: certificate is good with this patch a gpgsm[23045]: looking for another certificate is inserted into the log. Signed-off-by: Werner Koch <[email protected]>
| * g10: Block signals in g10_exit.NIIBE Yutaka2019-06-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (g10_exit): Block all signals before calling emergency_cleanup. -- There is a race condition here which results crash of the process. When a signal is delivered in emergency_cleanup, it is called again. This change fixes the problem. GnuPG-bug-id: 2747 Signed-off-by: NIIBE Yutaka <[email protected]>
| * agent: Allow TERM="".NIIBE Yutaka2019-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | * agent/call-pinentry.c (start_pinentry): When TERM is none, don't send OPTION ttytype to pinentry. -- GnuPG-bug-id: 4137 Signed-off-by: NIIBE Yutaka <[email protected]>
| * agent: Add pinentry_loopback_confirm declaration.NIIBE Yutaka2019-06-041-2/+5
| | | | | | | | | | | | * agent/agent.h (pinentry_loopback_confirm): New. Signed-off-by: NIIBE Yutaka <[email protected]>
| * scd: Remove unsupported --card-timeout option.NIIBE Yutaka2019-06-042-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/scdaemon.texi (card-timeout): Remove. * scd/scdaemon.c (main): Remove oCardTimeout handling. -- There was the card-timeout option in GnuPG 2.0, but it was never implemented correctly. The intention of this option was to allow sharing smartcard among multiple applications, but this didn't work well as user's expectation (it only worked with DISCONNECT command). This is because other parts of scdaemon assumes exclusive access. In GnuPG 2.1, the support of the option was removed, improving "DISCONNECT" command always works well without this option. GnuPG-bug-id: 3383 Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10,agent: Support CONFIRM for --delete-key.NIIBE Yutaka2019-06-043-3/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/call-pinentry.c (agent_get_confirmation): Add call of pinentry_loopback_confirm. (agent_popup_message_start): Likewise. (agent_popup_message_stop): Return if it's loopback mode. * agent/command.c (pinentry_loopback_confirm): New. * g10/call-agent.c (default_inq_cb): Support "CONFIRM" inquery when PINENTRY_MODE_LOOPBACK mode. (confirm_status_cb): New. (agent_delete_key): Supply confirm_status_cb to set the description string for confirmation. -- In the Assuan communication, we introduce new interaction: [gpg] [gpg-agent] --- CMD: PKDECRYPT --> <-- STATUS: SETDESC "..." <-- STATUS: SETOK "..." <-- STATUS: SETNOTOK "..." <-- INQUERY: CONFIRM 0/1 (0 for display, 1 for user query) --- INQUERY-result: --> <-- RESULT: ... GnuPG-bug-id: 3465 Signed-off-by: NIIBE Yutaka <[email protected]>
| * doc: Add a section for gpg-check-pattern.NIIBE Yutaka2019-06-032-1/+49
| | | | | | | | | | | | | | | | | | | | * doc/Makefile.am: Add gpg-check-pattern.1. * doc/tools.texi (GPG-CHECK-PATTERN): New. -- GnuPG-bug-id: 4031 Signed-off-by: NIIBE Yutaka <[email protected]>
| * Return better error code for some getinfo IPC commands.Werner Koch2019-06-033-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/command.c (cmd_getinfo): Return GPG_ERR_FALSE as boolean False. * g13/server.c (cmd_getinfo): Ditto. * sm/server.c (cmd_getinfo): Ditto. -- GPG_ERR_FALSE was introduced with libgpg-error 1.21 and we now require a later version for gnupg 2. Thus we can switch to this more descriptive code. Signed-off-by: Werner Koch <[email protected]>
| * agent: Add A-flag for KEYINFO output for card.NIIBE Yutaka2019-05-291-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/command.c (do_one_keyinfo): Add ON_CARD argument to put A-flag. (cmd_keyinfo): Call agent_card_keyinfo to offer additional information if it's on card. -- This is a modification in gpg-agent, intended for better enum_secret_keys in gpg frontend. GnuPG-bug-id: 4244 Signed-off-by: NIIBE Yutaka <[email protected]>
| * Add changes from 2.2 to NEWS.Werner Koch2019-05-281-0/+84
| | | | | | | | --
| * dirmngr: Allow for other hash algorithms than SHA-1 in OCSP.Werner Koch2019-05-281-25/+80
| | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/ocsp.c (do_ocsp_request): Remove arg md. Add args r_sigval, r_produced_at, and r_md. Get the hash algo from the signature and create the context here. (check_signature): Allow any hash algo. Print a diagnostic if the signature does not verify. -- GnuPG-bug-id: 3966 Signed-off-by: Werner Koch <[email protected]>
| * dirmngr: Improve finding OCSP cert.Werner Koch2019-05-281-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/certcache.c (find_cert_bysubject): Add better debug output and try to locate by keyid. -- This chnages was suggested in GnuPG-bug-id: 4536 but we do not have any test cases for this. Signed-off-by: Werner Koch <[email protected]>
| * agent: Make an MD encoding function more robust.Werner Koch2019-05-281-7/+12
| | | | | | | | | | | | | | | | | | | | | | * agent/pksign.c (do_encode_md): Use ascii_tolower and avoid uninitalized TMP in the error case. -- This is just in case libgcrypt ever returns an algorithm name longer than 15 bytes. Signed-off-by: Werner Koch <[email protected]>
| * agent: Remove unused agent_show_message.NIIBE Yutaka2019-05-282-72/+6
| | | | | | | | | | | | | | | | | | | | | | | | * agent/call-pinentry.c (agent_show_message): Remove. * agent/genkey.c (take_this_one_anyway): Rename from take_this_one_anyway2. Remove a dead path calling agent_show_message. (check_passphrase_constraints): Use take_this_one_anyway. -- Fixes-commit: 2778c6f8f40d73272075ce04c07097f65c94054e Signed-off-by: NIIBE Yutaka <[email protected]>
| * sm: Avoid confusing diagnostic for the default key.Werner Koch2019-05-273-24/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | * sm/certlist.c (cert_usage_p): Add arg 'silent' and change all callers. (gpgsm_cert_use_sign_p): Add arg 'silent' and pass to cert_usage_p. Change all callers. * sm/sign.c (gpgsm_get_default_cert): Set SILENT when calling gpgsm_cert_use_sign_p -- GnuPG-bug-id: 4535 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Fixed i18n markup of some strings.Werner Koch2019-05-271-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/tofu.c: Removed some translation markups which either make no sense or are not possble. -- Error message which are not helpful for the user but indicate a problem of the installation or the code do not need a translation. The translator may not understand them correctly and the use support can't immediately locate the problem because it needs to be reverse translated. There is also one case where certain grammar constructs are assumed (concatenating parts of a sentence at runtime). Better do not translate that than getting weird sentences.
| * gpg: Allow deletion of subkeys with --delete-[secret-]key.Werner Koch2019-05-275-14/+113
| | | | | | | | | | | | | | | | | | | | * common/userids.c (classify_user_id): Do not set the EXACT flag in the default case. * g10/export.c (exact_subkey_match_p): Make static, * g10/delkey.c (do_delete_key): Implement subkey only deleting. -- GnuPG-bug-id: 4457
| * agent: Stop scdaemon after reload when disable_scdaemon.NIIBE Yutaka2019-05-233-0/+13
| | | | | | | | | | | | | | | | | | | | * agent/call-scd.c (agent_card_killscd): New. * agent/gpg-agent.c (agent_sighup_action): Call agent_card_killscd. -- GnuPG-bug-id: 4326 Signed-off-by: NIIBE Yutaka <[email protected]>
| * g10: Copy expiredate from primary key when marked expired.NIIBE Yutaka2019-05-231-1/+5
| | | | | | | | | | | | | | | | | | * g10/getkey.c (merge_selfsigs): Update ->expiredate of subkey. -- GnuPG-bug-id: 3343 Signed-off-by: NIIBE Yutaka <[email protected]>
| * gpg: Do not bail on an invalid packet in the local keyring.Werner Koch2019-05-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (parse_keyblock_image): Treat invalid packet special. -- This is in particular useful to run --list-keys on a keyring with corrupted packets. The extra flush is to keep the diagnostic close to the regular --list-key output. Signed-off-by: Werner Koch <[email protected]>
| * gpg: Do not allow creation of user ids larger than our parser allows.Werner Koch2019-05-214-22/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/parse-packet.c: Move max packet lengths constants to ... * g10/packet.h: ... here. * g10/build-packet.c (do_user_id): Return an error if too data is too large. * g10/keygen.c (write_uid): Return an error for too large data. -- This can lead to keyring corruption becuase we expect that our parser is abale to parse packts created by us. Test case is gpg --batch --passphrase 'abc' -v \ --quick-gen-key $(yes 'a'| head -4000|tr -d '\n') GnuPG-bug-id: 4532 Signed-off-by: Werner Koch <[email protected]>
| * gpg: Unify the the use of the print_pubkey_info functions.Werner Koch2019-05-217-59/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keylist.c (format_seckey_info): Remove. (print_pubkey_info, print_seckey_info): Remove. (format_key_info): New. (print_key_info): New. (print_key_info_log): New. * g10/card-util.c (current_card_status): Use print_key_info and remove the useless condition on KEYBLOCK. * g10/delkey.c (do_delete_key): Replace print_pubkey_info and print_seckey_info by print_key_info. * g10/keyedit.c (menu_addrevoker): Replace print_pubkey_info by print_key_info. * g10/pkclist.c (do_we_trust_pre): Ditto. * g10/revoke.c (gen_desig_revoke): Ditto. (gen_revoke): Ditto. Also use print_key_info_log instead of separate functions. Signed-off-by: Werner Koch <[email protected]>
| * scd: Fix for SCARD_IO_REQUEST structure.NIIBE Yutaka2019-05-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | * scd/apdu.c (struct pcsc_io_request_s): Use pcsc_dword_t for Windows. -- This fix is for correctness and for the future when we will support 64-bit Windows. GnuPG-bug-id: 4454 Suggested-by: Juris Ozols Signed-off-by: NIIBE Yutaka <[email protected]>
| * agent: For SSH key, don't put NUL-byte at the end.NIIBE Yutaka2019-05-211-2/+2
| | | | | | | | | | | | | | | | | | | | * agent/command-ssh.c (ssh_key_to_protected_buffer): Update the length by the second call of gcry_sexp_sprint. -- GnuPG-bug-id: 4502 Signed-off-by: NIIBE Yutaka <[email protected]>