aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: Warn about (but don't fail) on scdaemon options in gpg.conf.Daniel Kahn Gillmor2014-09-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c: Add config options that should belong in scdaemon.conf * g10/main.h, g10/misc.c (obsolete_scdaemon_option): New. -- In gpg2, the following options are only relevant for scdaemon: reader-port ctapi-driver pcsc-driver disable-ccid but in gpg1, they are options for gpg itself. Some users of gpg1 might have these options in their ~/.gnupg/gpg.conf, which causes gpg2 to fail hard if it reads that config file. gpg2 should not fail hard, though giving a warning (and suggesting a move to scdaemon.conf) seems OK. This patch does *not* reintroduce any documentation for these options in gpg.texi, even to indicate that they are "dummy" options, since scdaemon.texi contains the appropriate documentation. Debian-bug-id: 762844 - Program names factored out from obsolete_scdaemon_option to make reuse without new translations easier. -wk
* gpg: Disable an MD5 workaround for pgp2 by default.Werner Koch2014-08-141-0/+15
| | | | | | | * g10/sig-check.c (do_check): Move some code to ... * g10/misc.c (print_md5_rejected_note): new function. * g10/mainproc.c (proc_tree, proc_plaintext): Enable MD5 workaround only if option --allow-weak-digest-algos is used.
* gpg: Remove options --pgp2 and --rfc1991.Werner Koch2014-08-141-10/+0
| | | | | | | | | | | | | | * g10/gpg.c (oRFC1991, oPGP2): Remove (opts): Remove --pgp2 and --rfc1991. * g10/options.h (CO_PGP2, CO_RFC1991): Remove. Remove all users. (RFC2440, PGP2): Remove. Remove all code only enabled by these conditions. * tests/openpgp/clearsig.test: Remove --rfc1991 test. -- The use of PGP 2.c is considered insecure for quite some time now (e.g. due to the use of MD5). Thus we remove all support for _creating_ PGP 2 compatible messages.
* gpg: Add command --quick-gen-keyWerner Koch2014-07-231-0/+14
| | | | | | | | | | | * g10/gpg.c (aQuickKeygen): New. * g10/misc.c (is_valid_user_id): New stub. * g10/keygen.c (quickgen_set_para): New. (quick_generate_keypair): New. -- Note that the validation of the specified user id has not yet been implemented.
* gpg: Avoid NULL-deref in default key listing.Werner Koch2014-06-021-33/+41
| | | | | | | | | * g10/keyid.c (hash_public_key): Take care of NULL keys. * g10/misc.c (pubkey_nbits): Ditto. -- This problem was mainly due to our ECC code while checking for opaque MPIs with the curve name.
* gpg: Mark experimental algorithms in the key listing.Werner Koch2014-05-071-2/+2
| | | | | | * g10/keylist.c (list_keyblock_print): Remove duplicate curve name. Print a note for experimental algorithms. * g10/misc.c (print_pubkey_algo_note): Fix warning message.
* gpg: New %U expando for the photo viewer.Werner Koch2014-04-171-0/+17
| | | | | | | | | * g10/photoid.c (show_photos): Set namehash. * g10/misc.c (pct_expando): Add "%U" expando. -- This makes is possible to extract all photos ids from a key to different files.
* w32: Include winsock2.h to silence warnings.Werner Koch2014-03-071-0/+3
|
* gpg: Avoid compiler warnings for disabled algos.Werner Koch2014-02-071-1/+63
| | | | | | * g10/misc.c (map_cipher_openpgp_to_gcry): Add case for disabled algo. (openpgp_pk_test_algo2): Ditto. (map_md_openpgp_to_gcry): Ditto.
* gpg: Add configure options to disable algorithmsWerner Koch2014-01-311-20/+43
| | | | | | | | | | | | | | | * acinclude.m4 (GNUPG_GPG_DISABLE_ALGO): New. * configure.ac: Add --enable-gpg-* options to disable non MUS algorithms. * g10/misc.c (map_cipher_openpgp_to_gcry): Implement these options. (openpgp_pk_test_algo2): Ditto. (map_md_openpgp_to_gcry): Ditto. (openpgp_cipher_test_algo, openpgp_md_test_algo): Simplify. -- We have a similar feature in GnuPG-1. Although we don't shrink the size of the gpg binary by disabling algorithms (they are implemented in Libgcrypt), this feature may still be useful for inerop testing.
* gpg: Improve --version algo info output.Werner Koch2014-01-311-3/+3
| | | | | | | | | | | | | | | * g10/misc.c (openpgp_pk_algo_name): Return a different string for each ECC algorithm. * g10/gpg.c (build_list_pk_test_algo): New wrapper to cope with the different algo type enums. (build_list_pk_algo_name): Ditto. (build_list_cipher_test_algo): Ditto. (build_list_cipher_algo_name): Ditto. (build_list_md_test_algo): Ditto. (build_list_md_algo_name): Ditto. (my_strusage): Use them. (list_config): Ditto. Add "pubkeyname". (build_list): Add letter==1 hack.
* gpg: Start using OpenPGP digest algo ids.Werner Koch2014-01-311-14/+51
| | | | | | | | | | | * g10/misc.c (print_pubkey_algo_note): Use enum typedef for the arg. (print_cipher_algo_note): Ditto. (print_digest_algo_note): Ditto. (map_md_openpgp_to_gcry): New. (openpgp_md_test_algo): Rewrite. (openpgp_md_algo_name): Rewrite to do without Libgcrypt. * g10/cpr.c (write_status_begin_signing): Remove hardwired list of algo ranges.
* gpg: Use only OpenPGP cipher algo ids.Werner Koch2014-01-311-24/+74
| | | | | | | | | | | | | | | | | | * g10/misc.c (map_cipher_openpgp_to_gcry): Use explicit mapping and use enums for the arg and return value. (map_cipher_gcry_to_openpgp): Ditto. (openpgp_cipher_blocklen): Use constant macros. (openpgp_cipher_test_algo): Use mapping function and prepare to disable algorithms. (openpgp_cipher_algo_name): Do not use Libgcrypt. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Replace CGRY_CIPHER_* by CIPHER_ALGO_*. * common/openpgpdefs.h (cipher_algo_t): Remove unused CIPHER_ALGO_DUMMY. Signed-off-by: Werner Koch <[email protected]>
* gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch2014-01-301-111/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* Change all quotes in strings and comments to the new GNU standard.Werner Koch2012-06-051-7/+7
| | | | | | | | | | | | | | | | | | | 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.
* Add tweaks for the not anymore patented IDEA algorithm.Werner Koch2012-05-081-18/+0
| | | | | | | | | | | | | | | * g10/keygen.c (keygen_set_std_prefs): Include IDEA only in PGP2 compatibility mode. * g10/misc.c (idea_cipher_warn): Remove. Also remove all callers. * common/status.h (STATUS_RSA_OR_IDEA): Remove. Do not emit this status anymore. -- To keep the number of actually used algorithms low, we want to support IDEA only in a basically read-only way (unless --pgp2 is used during key generation). It does not make sense to suggest the use of this old 64 bit blocksize algorithm. However, there is old data available where it might be helpful to have IDEA available.
* gpg: Fix segv with RSA_S keys.Werner Koch2012-01-111-0/+8
| | | | | | | | | | | | | | | * g10/misc.c (pubkey_get_npkey, pubkey_get_nskey) (pubkey_get_nsig, pubkey_get_nenc): Map all RSA algo ids to GCRY_PK_RSA. -- The problem is that Libgcrypt has no more support for the alternate RSA ids and thus if asking for the number of parameters, they will return zero. Now, this leads to packing the key parameters into an opaque MPI but because the algorithm id is actually known to GPG, it assumes valid RSA parameters. An example key with RSA_S is 0x5434509D.
* Minor code cleanups.Werner Koch2011-03-031-7/+5
| | | | | | | * keyid.c (hash_public_key): Remove shadowing NBITS. * misc.c (pubkey_nbits): Replace GCRY_PK_ by PUBKEY_ALGO_. (get_signature_count): Remove warning.
* Relax mailbox name checking. Fixes bug#1315.Werner Koch2011-02-031-41/+40
|
* Move OpenPGP OID helpers to common/.Werner Koch2011-01-311-201/+0
| | | | | | | This is needed so that the agent will be able to export and import OpenPGP secret keys. Add test case. Removed unused function.
* Reworked the ECC changes to better fit into the Libgcrypt API.Werner Koch2011-01-311-26/+278
| | | | | See ChangeLog for details. Key generation, signing and verification works. Encryption does not yet work. Requires latest Libgcrypt changes.
* Function name cleanupsWerner Koch2011-01-261-88/+4
| | | | Also nuked some trailing spaces.
* Started with some code cleanups in ECDH.Werner Koch2011-01-251-1/+1
| | | | | | The goal is to have the ECDH code more uniform with the other algorithms. Also make error messages and variable names more similar to other places.
* Make most of the selftests work.Werner Koch2011-01-211-19/+1
| | | | | Note that there is still a problem with tests/openpgp/sigs.test while using the option --digest-algo SHA256.
* Editorial changes and allow building with old libgcrypts.Werner Koch2011-01-211-61/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+142
| | | | | | | | | | 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-1/+1
|
* Smartcard related updatesWerner Koch2010-11-171-7/+6
|
* Make public key data structure easier to read.Werner Koch2010-10-201-1/+1
| | | | | Check vor v1 card while signing.
* More agent support for gpg.Werner Koch2010-10-131-4/+3
|
* Import OpenPGP keys into the agent.Werner Koch2010-08-311-0/+35
|
* ./autogen.sh --build-w32ce does now succeed.Werner Koch2010-04-141-7/+10
|
* Finished the bulk of changes to use estream in most places instead ofWerner Koch2010-03-151-18/+20
| | | | | stdio.
* Various changes to eventually support openpgp keys in pgp-agent.Werner Koch2010-02-021-23/+27
| | | | | | Comment fixes. Minor chnages in preparation of a W32CE port.
* Fix bug 1091.Werner Koch2009-07-201-1/+1
| | | | | | Doc fixes. Replace assert by error message.
* Add full Camellia support.David Shaw2009-06-051-11/+2
| | | | | | | | | | | | | | | | | | * configure.ac: Remove Camellia restriction. * gpg.c (main), misc.c (openpgp_cipher_test_algo): Remove Camellia restriction. * misc.c (map_cipher_openpgp_to_gcry), main.h: Add macros for openpgp_cipher_open, openpgp_cipher_get_algo_keylen, and openpgp_cipher_get_algo_blklen to wrap around the corresponding gcry_* functions, but pass the algorithm number through map_cipher_openpgp_to_gcry. This is needed in case the gcry algorithm number doesn't match the OpenPGP number (c.f. Camellia). * encr-data.c, pubkey-enc.c, mainproc.c, cipher.c, encode.c, seskey.c, passphrase.c, seckey-cert.c: Use new openpgp_cipher_* macros here.
* Import/export of pkcs#12 now uses the gpg-agent directly.Werner Koch2009-04-011-33/+0
| | | | | Removed duplicated code (percent unescaping).
* Add limited support for NetKey 3.0 cards.Werner Koch2009-01-081-8/+7
|
* Update spanish translation.Werner Koch2009-01-081-2/+13
| | | | | | Cleanups. Allow utf-8 in email addresses.
* Marked all unused args on non-W32 platforms.Werner Koch2008-10-201-4/+12
|
* * main.h, mainproc.c (check_sig_and_print), keylist.cDavid Shaw2008-10-031-15/+37
| | | | | | | | | (list_keyblock_print), pkclist.c (do_edit_ownertrust), keyedit.c (menu_showphoto), photoid.c (generate_photo_id, show_photos), misc.c (pct_expando): Add %v and %V expandos so that displaying photo IDs can show the attribute validity tag (%v) and string (%V). Originally by Daniel Gillmor.
* Adjust for the changed Camellia draft.Werner Koch2008-04-181-5/+30
| | | | | | W32 gettext changes. Comment and typo fixes.
* Allow type 20 keys only with option --rfc2440.Werner Koch2007-12-121-0/+15
|
* Support DSA2.Werner Koch2007-12-121-4/+51
| | | | | | Support Camellia for testing. More audit stuff.
* Fix for bug 851.Werner Koch2007-12-101-0/+1
| | | | | | Fixed auto generation of the stub key for the card. Allow to encrypt toElgamal encryption keys of type 20.
* 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.
* Ported changes from 1.4.Werner Koch2007-10-251-26/+43
| | | | | Add copyright notices.
* Updated estream.Werner Koch2007-08-221-4/+6
| | | | | More changes for Windows.
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* [w32] gpg-agent is now started automagically by gpgsm.Werner Koch2007-06-201-73/+0
|