aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch to the libgpg-error provided estream.Werner Koch2014-08-261-8/+6
| | | | | | | | | | * configure.ac (NEED_GPG_ERROR_VERSION): Reguire 1.14. (GPGRT_ENABLE_ES_MACROS): Define. (estream_INIT): Remove. * m4/estream.m4: Remove. * common/estream-printf.c, common/estream-printf.h: Remove. * common/estream.c, common/estream.h: Remove. * common/init.c (_init_common_subsystems): Call gpgrt initialization.
* common: Add z-base-32 encoder.Werner Koch2014-04-171-0/+2
| | | | | | | * common/zb32.c: New. * common/t-zb32.c: New. * common/Makefile.am (common_sources): Add zb82.c (module_tests): Add t-zb32.
* dirmngr: Default to a user socket name and enable autostart.Werner Koch2014-03-141-1/+2
| | | | | | | | | | | | | | | * common/homedir.c (dirmngr_socket_name): Rename to dirmngr_sys_socket_name. (dirmngr_user_socket_name): New. * common/asshelp.c (start_new_dirmngr): Handle sys and user dirmngr socket. * dirmngr/dirmngr.c (main): Ditto. * dirmngr/server.c (cmd_getinfo): Ditto. * sm/server.c (gpgsm_server): Ditto. * dirmngr/dirmngr-client.c (start_dirmngr): Likewise. * tools/gpgconf.c (main): Print "dirmngr-sys-socket" with --list-dirs. * configure.ac (USE_DIRMNGR_AUTO_START): Set by default.
* gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch2014-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* New debug functions log_printcanon and log_printsexp.Werner Koch2013-05-221-0/+5
| | | | | | | * common/sexputil.c (sexp_to_string, canon_sexp_to_string): New. (log_printcanon, log_printsexp): New. Signed-off-by: Werner Koch <[email protected]>
* Require libgpg-error 1.11.Werner Koch2013-03-051-10/+0
| | | | | | * configure.ac: Require libgpg-error 1.11. * common/util.h (GPG_ERR_NO_KEYSERVER, GPG_ERR_INV_CURVE) (GPG_ERR_UNKNOWN_CURVE): Remove fallback definitions.
* Do not use a broken ttyname.Werner Koch2012-11-201-3/+9
| | | | | | | | | | | | * configure.ac (HAVE_BROKEN_TTYNAME): New ac_define set for Android systems. * common/util.h (gnupg_ttyname): New macro. Change all callers of ttyname to use this macro instead. (ttyname) [W32]: Rename to _gnupg_ttyname and use also if HAVE_BROKEN_TTYNAME is defined. * common/simple-pwquery.c (agent_send_all_options): Keep on using ttyname unless HAVE_BROKEN_TTYNAME is set. This is because this file may be used standalone.
* common: Add a global variable to for the default error source.Werner Koch2012-02-061-1/+6
| | | | | | | | | | | | | | For the shared code parts it is cumbersome to pass an error sourse variable to each function. Its value is always a constant for a given binary and thus a global variable makes things a lot easier than the former macro stuff. * common/init.c (default_errsource): New global var. (init_common_subsystems): Rename to _init_common_subsystems. Set DEFAULT_ERRSOURCE. * common/init.h: Assert value of GPG_ERR_SOURCE_DEFAULT. (init_common_subsystems): New macro. * common/util.h (default_errsource): Add declaration. * kbx/keybox-defs.h: Add some GPG_ERR_SOURCE_DEFAULT trickery.
* Change JNLIB license to LGPLv3+ or GPLv2+.Werner Koch2011-09-301-11/+22
| | | | This is to allow the use of this code with code under GPLv2(only).
* Fix size_t vs int issues.Marcus Brinkmann2011-06-011-0/+1
|
* Require libgpg-error 1.10Werner Koch2011-05-201-15/+0
| | | | | This allows to remove some error code substitutes. Fixed a typo in gpg.text.
* Sample ECC keys and message do now work.Werner Koch2011-02-021-9/+15
| | | | | | | | 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.
* Move OpenPGP OID helpers to common/.Werner Koch2011-01-311-1/+5
| | | | | | | This is needed so that the agent will be able to export and import OpenPGP secret keys. Add test case. Removed unused function.
* Merge branch 'master' into ECC-INTEGRATION-2-1Werner Koch2011-01-241-0/+4
|\
| * All standard keyserver commands are now using dirmngr.Werner Koch2011-01-201-0/+1
| |
| * Initial code checking for backup - not yet working.Werner Koch2011-01-101-0/+3
| |
* | Integrating http://code.google.com/p/gnupg-ecc/source/detail?r=15 .Andrey Jivsov2011-01-061-0/+1
|/ | | | | | | | | | 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.
* s/AES/AES128/ in diagnostics and --list-configWerner Koch2010-12-021-0/+3
|
* More agent support for gpg.Werner Koch2010-10-131-0/+2
|
* Exporting secret keys via gpg-agent is now basically supported.Werner Koch2010-10-011-0/+6
| | | | | | A couple of forward ported changes. Doc updates.
* Obscure the cached passphrases.Werner Koch2010-09-021-0/+4
|
* Some work on porting dirmngr (unfinished)Werner Koch2010-07-161-0/+6
| | | | | Ported gpgtar to W32.
* Implement export of pkcs#12 objects using a direct agent connection.Werner Koch2010-06-211-1/+6
|
* Avoid using the protect-tool to import pkcs#12.Werner Koch2010-06-171-0/+2
|
* Merged Dirmngr with GnuPG.Werner Koch2010-06-091-0/+2
| | | | | A few code changes to support dirmngr.
* Add a separate header for time related fucntions.Werner Koch2010-04-201-41/+1
|
* ./autogen.sh --build-w32ce does now succeed.Werner Koch2010-04-141-0/+4
|
* Whole lot of changes to support CE.Werner Koch2010-04-141-0/+2
|
* More chnages to use estream. Add a way to replace the standardWerner Koch2010-03-221-1/+0
| | | | | descriptors.
* Builds again for W32.Werner Koch2010-03-151-5/+0
|
* Finished the bulk of changes to use estream in most places instead ofWerner Koch2010-03-151-3/+2
| | | | | stdio.
* Merged jnlib into common.Werner Koch2010-03-101-13/+14
|
* First steps towards the W32CE portWerner Koch2010-03-021-0/+7
|
* Print status of CRL checks in the audit log.Werner Koch2009-07-231-0/+5
|
* Alow batch ode for gpgsm --gen-key.Werner Koch2009-07-011-0/+3
| | | | | Allow CSR generation using an existing key with gpgsm.
* New helper function factored out of ../scd and equipped with test code.Werner Koch2009-05-071-0/+9
|
* Import/export of pkcs#12 now uses the gpg-agent directly.Werner Koch2009-04-011-0/+5
| | | | | Removed duplicated code (percent unescaping).
* Remove duplicated code.Werner Koch2009-03-161-0/+1
|
* New gpg-agent command to list key information.Werner Koch2009-03-061-1/+3
| | | | | | Gpgsm does now print the S/N of cards. Consider ephemeral keys during listing an export.
* Add a custom prompt for the CSR generation.Werner Koch2008-12-051-0/+3
| | | | | Add a new percent escape fucntion.
* Revamped the W32 gettext implementation.Werner Koch2008-11-041-0/+1
|
* Use more warning options with modern GCCs.Werner Koch2008-10-171-0/+7
| | | | | Other minor changes.
* Fix gpg-preset-passphrase bug.Werner Koch2008-09-031-0/+3
| | | | | Cleanups
* Add Base64 decoder. Not yet used but complements out encoder.Werner Koch2008-06-091-1/+12
|
* As a failsafe measure use memcpy instead of strcpy in gnupg_copy_time.Werner Koch2008-06-051-4/+10
| | | | | Typo fix.
* Fixed segv in gpg-agent (command marktrusted).Werner Koch2008-05-271-0/+2
| | | | | | Replaced almost all free by xfree. Translation fixes.
* Minor cleanups.Werner Koch2008-04-071-0/+1
| | | | | Implemented key helper kdns
* Allow verification of some broken S-TRUST generated signatures.Werner Koch2007-12-131-0/+1
|
* Created help files form the current po entries.Werner Koch2007-12-041-1/+1
|