aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (unfollow)
Commit message (Collapse)AuthorFilesLines
2012-06-25gpg: Disallow the use of v3 keys.disallow-v3-keysWerner Koch4-4/+89
* g10/gpg.c: Add options --allow-v3-keys and --no-allow-v3-keys. (main): Enable --allow-v3-keys in --pgp2 mode. * g10/options.h (opt): Add field allow_v3_keys. * g10/import.c (delete_v3_subkeys): New. (import_one): Skip v3 keys and delete v3 subkeys. (import_print_stats): Print stats on v3 keys and subkeys. * g10/getkey.c (finish_lookup): Skip v3 keys. -- This is a first take on disabling v3 keys. We may need to add some tweaks to make decryption using an existing v3 key easier. There is no need to disallow decryption. Thanks to Georgi Guninski to put some pressure on us to finally do what PGP 2 folks will probably don’t like. See the discussion on gnupg-devel starting 2012-06-22.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch27-205/+205
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.
2012-05-24Print the hash algorithm in colon mode key listing.Werner Koch1-6/+2
* g10/keylist.c (list_keyblock_colon): Print digest_algo.
2012-05-24Fix type conflict warning.Werner Koch1-2/+2
* g10/keylist.c: Change min_cert_level to a byte.
2012-05-08Add tweaks for the not anymore patented IDEA algorithm.Werner Koch8-58/+1
* 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.
2012-03-27Print warning for arguments not considered an option.Werner Koch1-2/+12
GnuPG requires that options are given before other arguments. This can sometimes be confusing. We now print a warning if we found an argument looking alike a long option without being preceded by the stop option. This is bug#1343. * common/argparse.h (ARGPARSE_FLAG_STOP_SEEN): New. * common/argparse.c (arg_parse): Set new flag. * g10/gpg.c (main): Print the warning. * agent/gpg-agent.c (main): Ditto. * dirmngr/dirmngr.c (main): Ditto. * g13/g13.c (main): Ditto. * scd/scdaemon.c (main): Ditto. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpgconf.c (main): Ditto.
2012-03-26Allow compress algorithm 0.Werner Koch1-3/+1
* g10/mainproc.c (proc_compressed): Remove superfluous check for compress algorithm 0. Reported by pfandrade. This is bug#1326.
2012-02-06common: Add a global variable to for the default error source.Werner Koch2-0/+2
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.
2012-02-01Honor --cert-digest-algo when recreating a cert.David Shaw1-2/+7
* g10/sign.c (update_keysig_packet): Honor --cert-digest-algo when recreating a cert. This is used by various things in --edit-key like setpref, primary, etc. Suggested by Christian Aistleitner.
2012-01-20Changes to --min-cert-level should cause a trustdb rebuild (issue 1366)David Shaw6-18/+34
* g10/gpgv.c, g10/trustdb.c (read_trust_options): Add min_cert_level * g10/trustdb.c (check_trustdb_stale): Request a rebuild if pending_check_trustdb is true (set when we detect a trustdb parameter has changed). * g10/keylist.c (public_key_list): Use 'l' in the "tru" with-colons listing for min_cert_level not matching. * g10/tdbio.c (tdbio_update_version_record, create_version_record, tdbio_db_matches_options, tdbio_dump_record, tdbio_read_record, tdbio_write_record): Add a byte for min_cert_level in the tdbio version record.
2012-01-11gpg: Fix segv with RSA_S keys.Werner Koch1-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.
2011-12-15Merge fix for issue 1331 from 1.4.David Shaw1-3/+2
* photoid.c (generate_photo_id): Check for the JPEG magic numbers instead of JFIF since some programs generate an EXIF header first.
2011-12-02Avoid possible double free in export.c.Werner Koch1-1/+1
* g10/export.c (transfer_format_to_openpgp): Avoid possible double free of LIST. Reported by NIIBE Yutaka.
2011-12-01Generate the ChangeLog from commit logs.Werner Koch2-6/+17
* scripts/gitlog-to-changelog: New script. Taken from gnulib. * scripts/git-log-fix: New file. * scripts/git-log-footer: New file. * doc/HACKING: Describe the ChangeLog policy * ChangeLog: New file. * Makefile.am (EXTRA_DIST): Add new files. (gen-ChangeLog): New. (dist-hook): Run gen-ChangeLog. Rename all ChangeLog files to ChangeLog-2011.
2011-11-30Rewrite dns-cert.c to not use the gpg-only iobuf stuff.Werner Koch2-20/+21
* common/dns-cert.c: Remove iobuf.h. (get_dns_cert): Rename to _get_dns_cert. Remove MAX_SIZE arg. Change iobuf arg to a estream-t. Rewrite function to make use of estream instead of iobuf. Require all parameters. Return an gpg_error_t error instead of the type. Add arg ERRSOURCE. * common/dns-cert.h (get_dns_cert): New macro to pass the error source to _gpg_dns_cert. * common/t-dns-cert.c (main): Adjust for changes in get_dns_cert. * g10/keyserver.c (keyserver_import_cert): Ditto. * doc/gpg.texi (GPG Configuration Options): Remove max-cert-size.
2011-11-30Increase the default buffer size for DNS certificates.Werner Koch2-2/+7
* common/t-dns-cert.c (main): Increase MAX_SIZE to 64k. * g10/keyserver.c (DEFAULT_MAX_CERT_SIZE): Increase from 16k to 64k.
2011-11-22Don't print anonymous recipient messages in quiet mode.Werner Koch2-3/+10
This is bug#1378.
2011-11-06Allow creating subkeys using an existing keyWerner Koch8-63/+246
This works by specifying the keygrip instead of an algorithm (section number 13) and requires that the option -expert has been used. It will be easy to extend this to the primary key.
2011-09-28Add a flag parameter to dotlock_create.Werner Koch5-7/+8
This allows us to extend this function in the future.
2011-09-23Renamed the lock functions.Werner Koch6-28/+37
Also cleaned up the dotlock code for easier readability.
2011-09-20Allow NULL for free_public_key.Werner Koch8-34/+36
2011-09-20avoid use of freed pointerJim Meyering2-1/+11
Without this patch, pk2 would be freed twice. >From 2a18a4b757e0896e738fefbbaa8ff8c23a9edf89 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Tue, 20 Sep 2011 16:20:39 +0200 Subject: [PATCH] avoid use of freed pointer If we free pk2 at the top of the for-loop, set it to NULL so that we don't free it again just before returning. * revoke.c (gen_desig_revoke): Don't use pk2 after freeing it.
2011-09-20Replace gcry_md_start_debug by gcry_md_debug.Werner Koch5-9/+18
This is to allow building with Libgcrypt master (1.6) which has some cleanups in the API/ABI.
2011-08-10Fixed set but unused variable bugsWerner Koch6-31/+37
2011-07-29Do not print read-only trustdb warning with --quiet.Werner Koch2-1/+5
This is only a warning and gpg would anyway print an error message if it tries to write to the trustdb.
2011-07-18Print decoded S2K count in --list-packets mode.Werner Koch2-1/+15
Fixes bug#1355.
2011-06-16Allow generation of card keys up to 4096 bit.Werner Koch3-16/+84
This patch implementes a chunk mode to pass the key parameters from scdaemon to gpg. This allows to pass arbitrary long key paremeters; it is used for keys larger than 3072 bit. Note: the card key generation in gpg is currently broken. The keys are generated but it is not possible to create the self-signature because at that time the gpg-agent does not yet know about the new keys and thus can't divert the sign request to the card. We either need to run the learn command right after calling agent_scd_genkey or implement a way to sign using the currently inserted card. Another option would be to get rid of agent_scd_genkey and implement the feature directly in agent_genkey.
2011-06-13Fix for latest fix in Libgcrypt.Werner Koch2-1/+8
2011-06-01Fix size_t vs int issues.Marcus Brinkmann5-10/+19
2011-04-29Re-indentation of keydb.c and error code changes.Werner Koch8-348/+403
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.
2011-04-29Fix import stat counter and abort secret key import on merge-only error case.Marcus Brinkmann2-25/+36
2011-04-29Give sensible error messages when trying to delete secret key.Marcus Brinkmann2-11/+26
2011-04-28Removed memory leak in the ECDH code.Werner Koch2-32/+59
2011-04-26Fixed regression in OpenPGP secret key export.Werner Koch2-4/+8
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.
2011-04-25Fix regression in gpg's mail address parsing.Werner Koch7-10/+20
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-04-202011-04-20 Marcus Brinkmann <[email protected]>Marcus Brinkmann2-1/+6
* keylist.c (list_keyblock_colon): Use get_ownertrust_info, not get_ownertrust (which lead to binary zeroes in the output!).
2011-03-28Detect premature EOF while parsing corrupted key packets.Werner Koch2-17/+31
This helps in the case of an unknown key algorithm with a corrupted packet which claims a longer packet length. This used to allocate the announced packet length and then tried to fill it up without detecting an EOF, thus taking quite some time. IT is easy to fix, thus we do it. However, there are many other ways to force gpg to use large amount of resources; thus as before it is strongly suggested that the sysadm uses ulimit do assign suitable resource limits to the gpg process. Suggested by Timo Schulz.
2011-03-10Make use of gcry_kdf_derive.Werner Koch2-77/+24
Factoring common code out is always a Good Thing. Also added a configure test to print an error if gcry_kdf_derive is missing in Libgcrypt.
2011-03-08Require libgcrypt 1.5Werner Koch3-18/+6
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.
2011-03-03Print the secret keyinfo stuff with --card-status again.Werner Koch3-65/+79
2011-03-03Minor code cleanups.Werner Koch3-8/+10
* keyid.c (hash_public_key): Remove shadowing NBITS. * misc.c (pubkey_nbits): Replace GCRY_PK_ by PUBKEY_ALGO_. (get_signature_count): Remove warning.
2011-03-03Fix faulty gcc warningsWerner Koch2-6/+10
2011-03-02Fix usage of SHA-2 algorithm with OpenPGP cards.Werner Koch3-148/+5
This was a regression in 2.1 introduced due to having the agent do the signing in contrast to the old "SCD PKSIGN" command which accesses the scdaemon directly and passed the hash algorithm. The hash algorithm is used by app-openpgp.c only for a sanity check.
2011-02-10Add ECC import regression tests and fixed a regression.Werner Koch2-16/+17
The import test imports the keys as needed and because they are passphrase protected we now need a pinentry script to convey the passphrase to gpg-agent.
2011-02-09Replace printf by es_printf in keyserver.cWerner Koch2-27/+28
This is similar to the change in keylist.c and elsewhere.
2011-02-08Add finger support to dirmngr.Werner Koch3-26/+89
The basic network code from http.c is used for finger. This keeps the network related code at one place and we are able to use the somewhat matured code form http.c. Unfortunately I had to enhance the http code for more robustness and probably introduced new bugs. Test this code using gpg --fetch-key finger:[email protected] (I might be the last user of finger ;-)
2011-02-07Fix ECDSA 521 bit signing.Werner Koch2-15/+20
This fix also allows the creation and use of an 521 bit ECDH key which used to fail while creating the binding signature.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch54-926/+906
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.
2011-02-04Removed deprecated SIGEXPIRED status line.Werner Koch2-2/+5
2011-02-03Fix test for gcry_pk_get_curve.Werner Koch2-1/+4
Add a compatibility fixes for the non-curve case. Remove -lber from the dirmngr link line.