aboutsummaryrefslogtreecommitdiffstats
path: root/g10/export.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: Add option --print-dane-records.Werner Koch2015-10-081-8/+9
| | | | | | | | | | | | | | | * g10/options.h (opt): Add field "print_dane_records". * g10/gpg.c (oPrintDANERecords): new. (opts): Add --print-dane-records. (main): Set that option. * g10/export.c (do_export): Remove EXPORT_DANE_FORMAT handling. (do_export_stream): Add EXPORT_DANE_FORMAT handling. * g10/keylist.c (list_keyblock_pka): Implement DANE record printing. * g10/gpgv.c (export_pubkey_buffer): New stub. * g10/test-stubs.c (export_pubkey_buffer): New stub. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove unfinished experimental code to export as S-expressions.Werner Koch2015-10-071-174/+9
| | | | | | | | | | | | | * g10/options.h (EXPORT_SEXP_FORMAT): Remove. (EXPORT_DANE_FORMAT): New. * g10/export.c (parse_export_options): Remove "export-sexp-format". (export_seckeys): Adjust for removed option. (export_secsubkeys): Ditto. (do_export): Prepare for DANE format. (build_sexp, build_sexp_seckey): Remove. (do_export_stream): Remove use of removed functions. Signed-off-by: Werner Koch <[email protected]>
* common: Don't assume on-disk layout matches in-memory layout.Neal H. Walfield2015-08-211-1/+1
| | | | | | | | | | | * g10/packet.h (PKT_signature): Change revkey's type from a struct revocation_key ** to a struct revocation_key *. Update users. -- revkey was a pointer into the raw data. But, C doesn't guarantee that there is no padding. Thus, we copy the data. Signed-off-by: Neal H. Walfield <[email protected]>.
* gpg: Fix export problem in case an old keyring has PGP-2 keys.Werner Koch2015-06-191-1/+8
| | | | | | * g10/export.c (do_export_stream): Skip legacy keys. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix export bug using exact search with only one key in the keybox.Werner Koch2014-12-011-0/+2
| | | | | | | | * g10/export.c (do_export_stream): Disable caching. * g10/keyserver.c (keyidlist): Ditto. -- GnuPG-bug-id: 1774
* gpg: Avoid extra pinentries for each subkey in --export-secret-keys.Werner Koch2014-11-021-1/+5
| | | | | | | | * agent/command.c (cmd_export_key): Actually implement the cache_nonce feature. * g10/export.c (do_export_stream): Make use of a cache_nonce. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix export of ecc secret keys by adjusting check ordering.Kyle Butt2014-09-011-1/+5
| | | | | | * g10/export.c (transfer_format_to_openpgp): Move the check against PUBKEY_MAX_NSKEY to after the ECC code adjusts the number of parameters.
* gpg: Remove --compress-keys and --compress-sigs feature.Werner Koch2014-08-141-2/+0
| | | | | | | | | | | | | * g10/gpg.c (oCompressKeys, oCompressSigs): Remove. (opts): Turn --compress-keys and --compress-signs in NOPs. * g10/options.h (opt): Remove fields compress_keys and compress_sigs. * g10/export.c (do_export): Remove compress_keys feature. * g10/sign.c (sign_file): Remove compress_sigs feature. -- These features are disabled in GnuPG since the very early days and they fulfill no real purpose. For now we keep the command line options as dummys.
* gpg: Create exported secret files and revocs with mode 700.Werner Koch2014-06-301-1/+1
| | | | | | | | | | | | | | | * common/iobuf.c (direct_open): Add arg MODE700. (iobuf_create): Ditto. * g10/openfile.c (open_outfile): Add arg RESTRICTEDPERM. Change call callers to pass 0 for it. * g10/revoke.c (gen_desig_revoke, gen_revoke): Here pass true for new arg. * g10/export.c (do_export): Pass true for new arg if SECRET is true. -- GnuPG-bug-id: 1653. Note that this works only if --output has been used.
* gpg: Make export of ECC keys work again.Werner Koch2014-06-201-55/+96
| | | | | | | | * agent/cvt-openpgp.c (convert_to_openpgp): Use the curve name instead of the curve parameters. * g10/export.c (canon_pubkey_algo): Rename to ... (canon_pk_algo): this. Support ECC. (transfer_format_to_openpgp): Expect curve name.
* gpg: Fix regression in secret key export.Werner Koch2014-04-151-2/+8
| | | | | | | | | | * agent/cvt-openpgp.c (convert_to_openpgp): Fix use gcry_sexp_extract_param. * g10/export.c (do_export_stream): Provide a proper prompt to the agent. -- NB: The export needs more work, in particular the ECC algorithms.
* Silence several warnings when building under Windows.Werner Koch2014-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * agent/call-scd.c (start_scd): Replace int by assuan_fd_t. (start_pinentry): Ditto. * common/asshelp.c (start_new_gpg_agent): Replace int by assuan_fd_t. * common/dotlock.c (GNUPG_MAJOR_VERSION): Include stringhelp.h for prototypes on Windows and some other platforms. * common/logging.c (fun_writer): Declare addrbuf only if needed. * g10/decrypt.c (decrypt_message_fd) [W32]: Return not_implemented. * g10/encrypt.c (encrypt_crypt) [W32]: Return error if used in server mode. * g10/dearmor.c (dearmor_file, enarmor_file): Replace GNUPG_INVALID_FD by -1 as temporary hack for Windows. * g10/export.c (do_export): Ditto. * g10/revoke.c (gen_desig_revoke, gen_revoke): Ditto. * g10/sign.c (sign_file, clearsign_file, sign_symencrypt_file): Ditto. * g10/server.c (cmd_verify, gpg_server) [W32]: Return an error. -- The gpg server mode is not actual working and thus we can avoid the warnings by explicitly disabling the mode. We keep it working under Unix, though.
* gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch2014-01-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/sexputil.c (get_pk_algo_from_canon_sexp): Change to return a string. * g10/keygen.c (check_keygrip): Adjust for change. * sm/certreqgen-ui.c (check_keygrip): Likewise. * agent/pksign.c (do_encode_dsa): Remove bogus map_pk_openpgp_to_gcry. * g10/misc.c (map_pk_openpgp_to_gcry): Remove. (openpgp_pk_test_algo): Change to a wrapper for openpgp_pk_test_algo2. (openpgp_pk_test_algo2): Rewrite. (openpgp_pk_algo_usage, pubkey_nbits): Add support for EdDSA. (openpgp_pk_algo_name): Rewrite to remove need for gcry calls. (pubkey_get_npkey, pubkey_get_nskey): Ditto. (pubkey_get_nsig, pubkey_get_nenc): Ditto. * g10/keygen.c(do_create_from_keygrip): Support EdDSA. (common_gen, gen_ecc, ask_keysize, generate_keypair): Ditto. * g10/build-packet.c (do_key): Ditto. * g10/export.c (transfer_format_to_openpgp): Ditto. * g10/getkey.c (cache_public_key): Ditto. * g10/import.c (transfer_secret_keys): Ditto. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto. * g10/mainproc.c (proc_pubkey_enc): Ditto. * g10/parse-packet.c (parse_key): Ditto, * g10/sign.c (hash_for, sign_file, make_keysig_packet): Ditto. * g10/keyserver.c (print_keyrec): Use openpgp_pk_algo_name. * g10/pkglue.c (pk_verify, pk_encrypt, pk_check_secret_key): Use only OpenPGP algo ids and support EdDSA. * g10/pubkey-enc.c (get_it): Use only OpenPGP algo ids. * g10/seskey.c (encode_md_value): Ditto. -- This patch separates Libgcrypt and OpenPGP public key algorithms ids and in most cases completely removes the Libgcrypt ones. This is useful because for Libgcrypt we specify the algorithm in the S-expressions and the public key ids are not anymore needed. This patch also adds some support for PUBKEY_ALGO_EDDSA which will eventually be used instead of merging EdDSA with ECDSA. As of now an experimental algorithm id is used but the plan is to write an I-D so that we can get a new id from the IETF. Note that EdDSA (Ed25519) does not yet work and that more changes are required. The ECC support is still broken right now. Needs to be fixed. Signed-off-by: Werner Koch <[email protected]>
* gpg: Rework ECC support and add experimental support for Ed25519.Werner Koch2013-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/findkey.c (key_parms_from_sexp): Add algo name "ecc". (agent_is_dsa_key): Ditto. (agent_is_eddsa_key): New. Not finished, though. * agent/pksign.c (do_encode_eddsa): New. (agent_pksign_do): Use gcry_log_debug functions. * agent/protect.c (agent_protect): Parse a flags parameter. * g10/keygen.c (gpg_curve_to_oid): Move to ... * common/openpgp-oid.c (openpgp_curve_to_oid): here and rename. (oid_ed25519): New. (openpgp_oid_is_ed25519): New. (openpgp_oid_to_curve): New. * common/t-openpgp-oid.c (test_openpgp_oid_is_ed25519): New. * g10/build-packet.c (gpg_mpi_write): Write the length header also for opaque MPIs. (gpg_mpi_write_nohdr): New. (do_key): Use gpg_mpi_write_nohdr depending on algorithm. (do_pubkey_enc): Ditto. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Use gpg_mpi_write_nohdr. * g10/export.c (transfer_format_to_openpgp): * g10/keygen.c (ecckey_from_sexp): Return the error. (gen_ecc): Repalce arg NBITS by CURVE. (read_parameter_file): Add keywords "Key-Curve" and "Subkey-Curve". (ask_curve): New. (generate_keypair, generate_subkeypair): Use ask_curve. (do_generate_keypair): Also pass curve name. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Print curve name. * g10/parse-packet.c (mpi_read): Remove workaround for Libcgrypt < 1.5. (parse_key): Fix ECC case. Print the curve name. * g10/pkglue.c (mpi_from_sexp): Rename to get_mpi_from_sexp. (pk_verify, pk_check_secret_key): Add special case for Ed25519. * g10/seskey.c (encode_md_value): Ditto. * g10/sign.c (do_sign, hash_for, sign_file): Ditto. -- Be warned that this code is subject to further changes and that the format will very likely change before a release. There are also known bugs and missing code. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove a function wrapper.Werner Koch2013-01-081-1/+1
| | | | | | * g10/keydb.h (keydb_search): Remove macro. * g10/keydb.c (keydb_search2): Rename to keydb_search. Change all callers.
* Change all quotes in strings and comments to the new GNU standard.Werner Koch2012-06-051-1/+1
| | | | | | | | | | | | | | | | | | | 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.
* Avoid possible double free in export.c.Werner Koch2011-12-021-1/+1
| | | | | * g10/export.c (transfer_format_to_openpgp): Avoid possible double free of LIST. Reported by NIIBE Yutaka.
* Fixed set but unused variable bugsWerner Koch2011-08-101-13/+13
|
* Re-indentation of keydb.c and error code changes.Werner Koch2011-04-291-1/+1
| | | | | | Returning -1 as an error code is not very clean given that gpg error has more descriptive error codes. Thus we now return GPG_ERR_NOT_FOUND for all search operations and adjusted all callers.
* Fixed regression in OpenPGP secret key export.Werner Koch2011-04-261-4/+3
| | | | | | | | The protection used in the exported key used a different iteration count than given in the S2K field. Thus all OpenPGP keys exported from GnuPG 2.1-beta can't be imported again. Given that the actual secret key material is kept in private-keys-v1.d/ the can be re-exported with this fixed version.
* Fix regression in gpg's mail address parsing.Werner Koch2011-04-251-1/+1
| | | | | | 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.
* Require libgcrypt 1.5Werner Koch2011-03-081-14/+3
| | | | | | | | Without Libgcrypt 1.5 is was not possible to use ECC keys. ECC is major new feature and thus it does not make sense to allow building with an older Libgcrypt without supporting ECC. Also fixed a few missing prototypes.
* Fix test for gcry_pk_get_curve.Werner Koch2011-02-031-1/+1
| | | | | Add a compatibility fixes for the non-curve case. Remove -lber from the dirmngr link line.
* Sample ECC keys and message do now work.Werner Koch2011-02-021-35/+113
| | | | | | | | Import and export of secret keys does now work. Encryption has been fixed to be compatible with the sample messages. This version tests for new Libgcrypt function and thus needs to be build with a new Libgcrypt installed.
* Merge branch 'master' into ECC-INTEGRATION-2-1Werner Koch2011-01-241-0/+54
|\
| * All standard keyserver commands are now using dirmngr.Werner Koch2011-01-201-0/+54
| |
* | Editorial changes and allow building with old libgcrypts.Werner Koch2011-01-211-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed order of some conditional to make to put the special case into the true branch. Indentation changes. Minor other changes to make the ECC code more similar to the rest of our code. It builds but many sefltests still fail. Need to fix that before using it with an ECDH enabled libgcrypt. [/] 2011-01-21 Werner Koch <[email protected]> * configure.ac: Need Libgcrypt 1.4.6 due to AESWRAP. (HAVE_GCRY_PK_ECDH): Add new test. [agent/] 2011-01-21 Werner Koch <[email protected]> * cvt-openpgp.c (GCRY_PK_ECDH) [!HAVE_GCRY_PK_ECDH]: New. [include/] 2011-01-21 Werner Koch <[email protected]> * cipher.h (GCRY_PK_USAGE_CERT): Remove compatibility macros because we now require libgcrypt 1.4.6. (GCRY_PK_ECDH): Add replacement.
* | Integrating http://code.google.com/p/gnupg-ecc/source/detail?r=15 .Andrey Jivsov2011-01-061-0/+12
|/ | | | | | | | | | The following works: gpg2 --gen-key (ECC) gpg2 --list-keys gpg2 --list-packets ~/.gnupg/pubring.gpg gpg2 --list-packets <private key from http://sites.google.com/site/brainhub/pgpecckeys> ECDH doesn't work yet as the code must be re-written to adjust for gpg-agent refactoring.
* Exporting secret keys via gpg-agent is now basically supported.Werner Koch2010-10-011-153/+598
| | | | | | A couple of forward ported changes. Doc updates.
* Removed more secret key related code.Werner Koch2010-09-061-416/+421
| | | | | | It builds fine and passes some of the tests but there are quite some features which don't work yet.
* More changes on the way to remove secring.gpg.Werner Koch2010-04-211-1/+1
|
* Generating an OpenPGP key cia gpg-agent basically works.Werner Koch2010-04-201-1/+1
|
* Unification of the search descriptor usage.Werner Koch2009-12-081-2/+3
|
* Some changes to suport g13.Werner Koch2009-09-301-1/+1
|
* Started to implement the audit log feature.Werner Koch2007-11-191-1/+1
| | | | | | | | Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* * export.c (do_export_stream): Allow reset-subkey-passwd alongWerner Koch2007-02-141-1/+4
| | | | | with sexp-format.
* Fixes for CVE-2006-6235Werner Koch2006-12-061-4/+5
|
* Fix for bug 537Werner Koch2006-10-021-9/+9
|
* Continued with merging.Werner Koch2006-04-191-1/+0
| | | | | Still does not build.
* Merged with gpg 1.4.3 code. Werner Koch2006-04-191-158/+367
| | | | | The gpg part does not yet build.
* Adjusted for use with current libgcrypt (1.1.42).Werner Koch2003-07-281-2/+2
|
* * export.c (parse_export_options): New option sexp-format.Werner Koch2003-07-161-29/+180
| | | | | | | | | (export_seckeys,export_secsubkeys): Check sexp-format option. (do_export): Ignore armor for sexp format. (do_export_stream): Handle sexp-format. (write_sexp_line,write_sexp_keyparm, build_sexp_seckey): New. (build_sexp): New.
* Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch2003-06-181-11/+10
| | | | | | | | | | | to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
* This commit was manufactured by cvs2svn to create branchRepo Admin2003-06-051-0/+396
| | | | 'GNUPG-1-9-BRANCH'.
* This commit was manufactured by cvs2svn to create branchRepo Admin2002-10-191-350/+0
| | | | 'GNUPG-1-9-BRANCH'.
* 2002-09-28 David Shaw <[email protected]>David Shaw2002-09-281-4/+4
| | | | | | | | | | | | | | * export.c (do_export_stream): Comment. * sig-check.c (check_key_signature2): Properly handle a non-designated revocation import. 2002-09-26 Werner Koch <[email protected]> * g10.c (set_homedir): New. Changed all direct assignments to use this. * gpgv.c (set_homedir): Ditto.
* Cleanups and minor fixes.Werner Koch2002-09-101-1/+1
|
* * keylist.c, keyedit.c, keyserver.c, sign.c: Some TODOs and comments.David Shaw2002-08-201-1/+4
| | | | | | | | | * export.c (do_export_stream): Fix noop bug in exporting sensitive revocation keys. * pkclist.c (do_edit_ownertrust): Comment out the option for showing trust paths until it can be implemented.
* * exec.c, export.c, import.c, keyedit.c, keyserver.c, misc.c: "Warning" ->David Shaw2002-07-251-1/+1
| | | | | "WARNING"