aboutsummaryrefslogtreecommitdiffstats
path: root/sm/export.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-01-29gpgsm: Allow unattended PKCS#12 export without passphrase.Werner Koch1-14/+20
* sm/gpgsm.c (oNoProtection): New. (opts): Add "--no-protection". (main): PArse it. * sm/gpgsm.h (struct server_control_s): Add field no_protection. * sm/server.c (option_handler): Add option "no-protection". (reset_notify): Clear option. * sm/export.c (export_p12): Use empty passphrase if option is set.
2024-07-09Use gpgrt_process_spawn API from libgpg-error.NIIBE Yutaka1-1/+0
* agent/genkey.c (do_check_passphrase_pattern): Use the gpgrt API. * common/asshelp.c (start_new_service): Ditto. * common/exechelp.h: Remove gnupg_process_spawn API. * common/exechelp-posix.c: Remove gnupg_process_spawn implementation. * common/exechelp-w32.c: Likewise. * common/exectool.c (gnupg_exec_tool_stream): Use the gpgrt API. * common/t-exechelp.c (test_pipe_stream): Remove. * dirmngr/ldap-wrapper.c (destroy_wrapper, ldap_reaper_thread): Use the gpgrt API. (ldap_wrapper_connection_cleanup, ldap_wrapper): Ditto. * dirmngr/ldap.c, g10/call-keyboxd.c: No need to include exechelp.h. * g10/photoid.c (run_with_pipe, show_photo): Use the gpgrt API. * g13/be-encfs.c (run_umount_helper, run_encfs_tool): Ditto. * g13/g13.c, g13/mount.c, g13/runner.c: No need to include exechelp.h. * scd/apdu.c: No need to include exechelp.h. * scd/app.c (report_change): Use the gpgrt API. * sm/export.c, sm/import.c: No need to include exechelp.h. * tests/gpgscm/ffi.c (proc_object_finalize, proc_wrap) (do_process_spawn_io, do_process_spawn_fd, do_process_wait): Use the gpgrt API. * tools/gpg-auth.c: No need to include exechelp.h. * tools/gpg-card.c (cmd_gpg): Use the gpgrt API. * tools/gpg-connect-agent.c: No need to include exechelp.h. * tools/gpg-mail-tube.c (mail_tube_encrypt, prepare_for_appimage) (start_gpg_encrypt): Use the gpgrt API. * tools/gpgconf-comp.c (gpg_agent_runtime_change) (scdaemon_runtime_change, tpm2daemon_runtime_change) (dirmngr_runtime_change, keyboxd_runtime_change) (gc_component_launch, gc_component_check_options) (retrieve_options_from_program): Ditto. * tools/gpgconf.c (show_versions_via_dirmngr): Ditto. * tools/gpgtar-create.c (gpgtar_create): Ditto. * tools/gpgtar-extract.c (gpgtar_extract): Ditto. * tools/gpgtar-list.c (gpgtar_list): Ditto. -- GnuPG-bug-id: 7192 Signed-off-by: NIIBE Yutaka <[email protected]>
2024-05-31indent: Fix spellingDaniel Kahn Gillmor1-2/+2
-- These are non-substantive corrections for minor spelling mistakes within the GnuPG codebase. With something like this applied to the codebase, and a judiciously tuned spellchecker integrated as part of a standard test suite, it should be possible to keep a uniform orthography within the project. GnuPG-bug-id: 7116
2023-10-24sm: Flag Brainpool curves as compliant for all other operations.Werner Koch1-1/+1
* sm/fingerprint.c (gpgsm_get_key_algo_info2): Rename to (gpgsm_get_key_algo_info): this. Remove the old wrapper. Adjust all callers. * sm/decrypt.c (gpgsm_decrypt): Pass the curve to the compliance checker. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6253
2021-05-17sm: Ask for the password for password based decryption (pwri)Werner Koch1-2/+2
* sm/decrypt.c (pwri_decrypt): Add arg ctrl. Ask for passphrase. * sm/export.c (export_p12): Mark string as translatable. * sm/import.c (parse_p12): Ditto. -- This is finishes the support for PWRI. The N_() marks are added so that we don't rely of the side-effect of having the same strings in protect-tool.c Signed-off-by: Werner Koch <[email protected]>
2020-09-10sm: Implement initial support for keyboxd.Werner Koch1-2/+2
* sm/gpgsm.h (MAX_FINGERPRINT_LEN): New. * sm/keydb.c (struct keydb_local_s): Change definition of search_result. (keydb_get_cert): Implement keyboxd mode. (keydb_get_flags): Temporary hack for keyboxd mode. Needs to be fixed. (struct store_parm_s, store_inq_cb): New. (keydb_insert_cert): Implement keyboxd mode. (keydb_locate_writable): Make static. (keydb_search_reset): Implement keyboxd mode. (search_status_cb): New. (keydb_search): Implement keyboxd mode. Replace return code -1 by GPG_ERR_NOT_FOUND. (keydb_set_cert_flags): Replace return code -1 by GPG_ERR_NOT_FOUND. * sm/keylist.c (list_cert_colon): Adjust for replacement of -1 by GPG_ERR_NOT_FOUND. (list_internal_keys): Ditto. * sm/sign.c (add_certificate_list): Ditto. * sm/certchain.c (find_up_search_by_keyid): Ditto. (find_up_external, find_up, find_up_dirmngr): Ditto. (gpgsm_walk_cert_chain): Ditto. (get_regtp_ca_info): Ditto. * sm/certlist.c (gpgsm_add_to_certlist): Ditto. (gpgsm_find_cert): Ditto. * sm/delete.c (delete_one): Ditto. * sm/export.c (gpgsm_export): Ditto. (gpgsm_p12_export): Ditto. * sm/import.c (gpgsm_import_files): Ditto. -- Note that keyboxd is not yet able to handle the ephemeral flag. This needs fixing here and in keyboxd. Delete et al. is also not yet implemented. A basic key listing works, though. Signed-off-by: Werner Koch <[email protected]>
2020-09-03sm: Add arg ctrl to keydb_new.Werner Koch1-2/+2
* sm/keydb.c (keydb_new): Add arg and change all callers. -- This will be used later.
2020-07-08gpgsm: Replace all assert calls by log_assert.Werner Koch1-1/+0
-- Signed-off-by: Werner Koch <[email protected]>
2020-04-27sm: Add support to export ECC private keys.Werner Koch1-33/+53
* sm/minip12.c [TEST]: Remove test code. Include util.h, tlv.h. and openpgpdefs.h. Remove the class and tag constants and replace them by those from tlv.h. (builder_add_oid, builder_add_mpi): New. (build_key_sequence): Rename to ... (build_rsa_key_sequence): this. (build_ecc_key_sequence): New. (p12_build): Call RSA or ECC builder. (p12_raw_build): Ditto. * sm/export.c (gpgsm_p12_export): Use correct armor header for ECC. (sexp_to_kparms): Support ECC. * sm/t-minip12.c: New to replace the former TEST code in minip12.h. -- GnuPG-bug-id: 4921
2020-02-18Spelling cleanup.Daniel Kahn Gillmor1-1/+1
No functional changes, just fixing minor spelling issues. --- Most of these were identified from the command line by running: codespell \ --ignore-words-list fpr,stati,keyserver,keyservers,asign,cas,iff,ifset \ --skip '*.po,ChangeLog*,help.*.txt,*.jpg,*.eps,*.pdf,*.png,*.gpg,*.asc' \ doc g13 g10 kbx agent artwork scd tests tools am common dirmngr sm \ NEWS README README.maint TODO Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2019-03-14kbx: Unify the fingerprint search modes.Werner Koch1-2/+0
* kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_FPR16) (KEYDB_SEARCH_MODE_FPR20, KEYDB_SEARCH_MODE_FPR32): Remove. Switch all users to KEYDB_SEARCH_MODE_FPR along with the fprlen value. -- These search modes were added over time and there has until recently be no incentive to remove the cruft. With the change for v5 keys I finally went over all places and allowed the generic fingerprint mode along with a given length of the fingerprint at all places. Consequently the other modes can now be removed. Signed-off-by: Werner Koch <[email protected]>
2018-02-14sm: Fix minor memory leak in --export-p12.Werner Koch1-0/+1
* sm/export.c (gpgsm_p12_export): Free KEYGRIP. Signed-off-by: Werner Koch <[email protected]>
2018-02-14sm: Fix a wrong key parameter in an exported private key fileKatsuhiro Ueno1-1/+1
* sm/export.c (sexp_to_kparms): Fix the computation of array[6], which must be 'd mod (q-1)' but was 'p mod (q-1)'. -- This bug is not serious but makes some consistency checks fail. For example, 'openssl rsa -check' reports the following error: $ gpgsm --out my.key --export-secret-key-raw 0xXXXXXXXX $ openssl rsa -check -noout -inform DER -in my.key RSA key error: dmq1 not congruent to d -- Let me(wk) add this: This bug was introduced with Fixes-commit: 91056b1976bfb7b755e53b1302f4ede2b5cbc05d right at the start of GnuPG 2.1 in July 2010. Before that (in 2.0) we used gpg-protect-tool which got it right. We probably never noticed this because gpgsm, and maybe other tools too, fix things up during import. Signed-off-by: Werner Koch <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-3/+3
* dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-02-16common: Rename remaining symbols in ksba-io-support.Werner Koch1-9/+9
* common/ksba-io-support.c (gpgsm_reader_eof_seen): Rename to ... (gnupg_ksba_reader_eof_seen): this. Change all callers. (gpgsm_destroy_reader): Rename to ... (gnupg_ksba_destroy_reader): this. Change all callers. (gpgsm_finish_writer): Rename to ... (gnupg_ksba_finish_writer): this. Change all callers. (gpgsm_destroy_writer): Rename to ... (gnupg_ksba_destroy_writer): this. Change all callers. * common/ksba-io-support.c (struct base64_context_s): Rename to ... (gnupg_ksba_io_s): this. * common/ksba-io-support.h (base64_context_s): Ditto. (Base64Context): Rename this typedef to ... (gnupg_ksba_io_t): this. Change all users. Signed-off-by: Werner Koch <[email protected]>
2017-02-16common: Remove gpgsm dependencies from ksba-io-support.Werner Koch1-2/+8
* common/ksba-io-support.c: Include ksba-io-support.h instead of ../sm/gpgsm.h. Include util.h. (writer_cb_parm_s): Remove const from 'pem_name'. (gpgsm_destroy_writer): Free 'pem_name'. (gpgsm_create_reader): Rename to ... (gnupg_ksba_create_reader): this. Replace args CTRL and ALLOW_MULTI_PEM by a new arg FLAGS. Change the code to evaluate FLAGS. Change all callers to pass the FLAGS. (gpgsm_create_writer): Rename to ... (gnupg_ksba_create_writer): this. Replace arg CTRL by new arg FLAGS. Add arg PEM_NAME. Evaluate FLAGS. Store a copy of PEM_NAME. Change all callers to pass the FLAGS and PEM_NAME. Signed-off-by: Werner Koch <[email protected]>
2016-11-10gpg,sm: Add STATUS_ERROR keydb_search and keydb_add-resource.Werner Koch1-3/+3
* g10/keydb.c (keydb_add_resource): Make ANY_REGISTERED file-global. Write a STATUS_ERROR. (maybe_create_keyring_or_box): Check for non-accessible but existant file. (keydb_search): Write a STATUS_ERROR if no keyring has been registered but continue to return NOT_FOUND. * sm/keydb.c (keydb_add_resource): Rename ANY_PUBLIC to ANY_REGISTERED and make file-global. Write a STATUS_ERROR. (keydb_search): Write a STATUS_ERROR if no keyring has been registered but continue to return NOT_FOUND. Also add new arg CTRL and change all callers to pass it down. Signed-off-by: Werner Koch <[email protected]>
2016-11-10sm: Remove unused arg SECRET from keydb functions.Werner Koch1-3/+2
* sm/keydb.c (struct resource_item): Remove field 'secret'. (keydb_add_resource): Remove arg 'secret' and change all callers. (keydb_new): Ditto. Signed-off-by: Werner Koch <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-01-26sm: small fix for GCC 6.NIIBE Yutaka1-1/+1
* sm/export.c (insert_duptable): Use unsigned 0. -- We can silence message with -Wshift-negative-value. Signed-off-by: NIIBE Yutaka <[email protected]>
2014-06-03gpgsm: New commands --export-secret-key-{p8,raw}Werner Koch1-21/+50
* sm/gpgsm.c: Add new commands. * sm/minip12.c (build_key_sequence): Add arg mode. (p12_raw_build): New. * sm/export.c (export_p12): Add arg rawmode. Call p12_raw_build. (gpgsm_p12_export): Ditto. (print_short_info): Print the keygrip.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-4/+4
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2011-04-25Fix regression in gpg's mail address parsing.Werner Koch1-2/+2
Since 2009-12-08 gpg was not able to find email addresses indicated by a leading '<'. This happened when I merged the user id classification code of gpgsm and gpg.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-37/+36
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2010-11-26Remove superfluous parameter.Werner Koch1-3/+2
Make self-check interval larger
2010-06-21Implement export of pkcs#12 objects using a direct agent connection.Werner Koch1-241/+226
2010-06-09Merged Dirmngr with GnuPG.Werner Koch1-1/+2
A few code changes to support dirmngr.
2010-03-24More changes for CE. gpgsm does now build and run a keylisting.Werner Koch1-13/+11
2010-03-08Removed almost al dup calls.Werner Koch1-16/+7
2010-03-08Replace use stdio by estream functions.Werner Koch1-16/+15
2009-12-08Unification of the search descriptor usage.Werner Koch1-2/+2
2009-04-01Import/export of pkcs#12 now uses the gpg-agent directly.Werner Koch1-3/+9
Removed duplicated code (percent unescaping).
2009-03-06New gpg-agent command to list key information.Werner Koch1-12/+10
Gpgsm does now print the S/N of cards. Consider ephemeral keys during listing an export.
2008-10-23Try to start the agent before invoking the protect-tool.Werner Koch1-2/+9
2008-05-20Fix --output option used when with --export-secret-kety-p12.Werner Koch1-1/+1
2008-01-27[W32] Avoid extra console window when importing or exporting.Werner Koch1-1/+1
Fixes bug 875.
2007-08-29New command --check-programs for gpgconf.Werner Koch1-1/+1
2007-08-23Add new features to kbxutil.Werner Koch1-4/+18
Fixed bug 829 (can't encrypt if duplicated certs are in the keybox)
2007-08-22Updated estream.Werner Koch1-2/+3
More changes for Windows.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-14A whole bunch of changes to allow building for Windows.Werner Koch1-1/+1
See the ChangeLogs for details.
2007-05-29Print passphrase encoding info only in PEM mode.Werner Koch1-1/+1
2007-03-20Allow setting of the passphrase encoding of pkcs#12 files.Werner Koch1-0/+11
New option --p12-charset.
2007-03-19Allow export to work on systems without funopen/fopencookie.Werner Koch1-22/+64
2006-10-02Fix for bug 537Werner Koch1-2/+2
2006-09-14Take advantage of newer gpg-error features.Werner Koch1-4/+4
2006-09-06The big Assuan error code removal.Werner Koch1-3/+3
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2005-09-09Bug fixes and ssh support for the BELPIC.Werner Koch1-0/+1
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-249/+0