aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* common: Fix regression in building argpase.c standalone.Werner Koch2015-09-011-0/+7
| | | | * common/argparse.c (is_native_utf8) [GNUPG_MAJOR_VERSION]: New.
* Typo fixesWerner Koch2015-09-012-2/+2
| | | | --
* g10: Don't leak memory if we fail to initialize a new database handle.Neal H. Walfield2015-08-311-9/+12
| | | | | | | | * g10/keydb.c (keydb_new): If we fail to open a keyring or keybox correctly release all resources. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* g10: Improve interface documentation of the keydb API.Neal H. Walfield2015-08-312-69/+223
| | | | | | | | | * g10/keydb.c: Improve code comments and documentation of internal interfaces. Improve documentation of public APIs and move that to... * g10/keydb.h: ... this file. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* g10: Don't cache search results if the search didn't scan the whole DB.Neal H. Walfield2015-08-311-1/+10
| | | | | | | | | | | * g10/keydb.c (struct keydb_handle): Add new field is_reset. (keydb_new): Initialize hd->is_reset to 1. (keydb_locate_writable): Set hd->is_reset to 1. (keydb_search): Set hd->is_reset to 0. Don't cache a key not found if the search started from the beginning of the database. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* g10: Have keydb_search_first call keydb_search_reset before searching.Neal H. Walfield2015-08-311-0/+4
| | | | | | | | | | | | * g10/keydb.c (keydb_search_first): Reset the handle before starting the search. -- Signed-off-by: Neal H. Walfield <[email protected]>. This bug hasn't shown up yet in practice, because keydb_search_first is always called immediately after a keydb_new. This changes cleans up the semantics and will hopefully prevent future bugs.
* g10: Remove unused parameter.Neal H. Walfield2015-08-314-6/+4
| | | | | | | | * g10/keydb.h (keydb_locate_writable): Remove unused parameter reserved. Update users. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* agent: Fix SSH public key for EdDSA.NIIBE Yutaka2015-08-311-0/+5
| | | | * agent/command-ssh.c (ssh_key_to_blob): Remove the prefix 0x40.
* g10: Simplify cache. Only include data that is actually used.Neal H. Walfield2015-08-262-64/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (struct kid_list_s): Rename from this... (struct kid_not_found_cache_bucket): ... to this. Update users. Remove field state. (kid_list_t): Remove type. (KID_NOT_FOUND_CACHE_BUCKETS): Define. Use this instead of a literal. (kid_found_table): Rename from this... (kid_not_found_cache_bucket): ... to this. Update users. (kid_found_table_count): Rename from this... (kid_not_found_cache_count): ... to this. Update users. (kid_not_found_p): Only return whether a key with the specified key id is definitely not in the database. (kid_not_found_insert): Remove parameter found. Update callers. (keydb_search): Only insert a key id in the not found cache if it is not found. Rename local variable once_found to already_in_cache. -- Signed-off-by: Neal H. Walfield <[email protected]>. Commit e0873a33 started tracking whether key ids where definitely in the database. This information is, however, never used and thus just unnecessarily inflates the cache. This patch effectively reverts that change (however, e0873a33 contains two separate changes and this only reverts that change).
* Add configure option --enable-build-timestamp.Werner Koch2015-08-251-1/+10
| | | | | | | | | | | | * configure.ac (BUILD_TIMESTAMP): Set to "<none>" by default. -- This is based on libgpg-error commit d620005fd1a655d591fccb44639e22ea445e4554 but changed to be disabled by default. Check there for some background. Signed-off-by: Werner Koch <[email protected]>
* gpg: Emit ERROR status for key signing failures.Werner Koch2015-08-251-0/+7
| | | | | | | | | | | | * g10/keyedit.c (sign_uids): Write an ERROR status for a signing failure. (menu_adduid, menu_addrevoker, menu_revsig): Ditto. (menu_revuid, menu_revkey, menu_revsubkey): Ditto. -- This change helps GPA to show better error messages. Signed-off-by: Werner Koch <[email protected]>
* gpg: Print a new FAILURE status after most commands.Werner Koch2015-08-256-28/+117
| | | | | | | | | | | | | | | | | | * common/status.h (STATUS_FAILURE): New. * g10/cpr.c (write_status_failure): New. * g10/gpg.c (main): Call write_status_failure for all commands which print an error message here. * g10/call-agent.c (start_agent): Print an STATUS_ERROR if we can't set the pinentry mode. -- This status line can be used similar to the error code returned by commands send over the Assuan interface in gpgsm. We don't emit them in gpgsm because there we already have that Assuan interface to return proper error code. This change helps GPGME to return better error codes. Signed-off-by: Werner Koch <[email protected]>
* agent: Raise the maximum password length. Don't hard code it.Neal H. Walfield2015-08-245-12/+17
| | | | | | | | | | | | | * agent/agent.h (MAX_PASSPHRASE_LEN): Define. * agent/command-ssh.c (ssh_identity_register): Use it instead of a hard-coded literal. * agent/cvt-openpgp.c (convert_from_openpgp_main): Likewise. * agent/findkey.c (unprotect): Likewise. * agent/genkey.c (agent_ask_new_passphrase): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>. GnuPG-bug-id: 2038
* sm: Support secret key export via the Assuan interface.Werner Koch2015-08-241-5/+31
| | | | | | * sm/server.c (cmd_export): Add options --secret, --raw, and --pkcs12. Signed-off-by: Werner Koch <[email protected]>
* po: Grammar fix for the German translation.Werner Koch2015-08-241-1/+1
| | | | | -- Reported-by: Thomas Bellmann
* dirmngr: Allow sending of Zack's key.Werner Koch2015-08-231-2/+3
| | | | | | * dirmngr/server.c (MAX_KEYBLOCK_LENGTH): Increase to 1 MiB. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix regression in packet parser from Aug 19.Werner Koch2015-08-231-15/+8
| | | | | | | | | * g10/parse-packet.c (parse): Use an int to compare to -1. Use buf32_to_ulong. -- Regression-due-to: 0add91ae1ca3718e8140af09294c595f47c958d3 Signed-off-by: Werner Koch <[email protected]>
* gpg: Show not found keys with --locate-key --verbose.Werner Koch2015-08-231-0/+3
| | | | | | * g10/keylist.c (locate_one): Print a diagnostic for a not-found key. Signed-off-by: Werner Koch <[email protected]>
* common: Don't incorrectly reject 4 GB - 1 sized packets.Neal H. Walfield2015-08-215-4/+34
| | | | | | | | | | | | | * g10/parse-packet.c (parse): Don't reject 4 GB - 1 sized packets. Add the constraint that the type must be 63. * kbx/keybox-openpgp.c (next_packet): Likewise. * tests/openpgp/4gb-packet.asc: New file. * tests/openpgp/4gb-packet.test: New file. * tests/openpgp/Makefile.am (TESTS): Add 4gb-packet.test. (TEST_FILES): Add 4gb-packet.asc. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common: Don't assume on-disk layout matches in-memory layout.Neal H. Walfield2015-08-216-20/+26
| | | | | | | | | | | * 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]>.
* common: Don't incorrectly copy packets with partial lengths.Neal H. Walfield2015-08-211-0/+11
| | | | | | | | | * g10/parse-packet.c (parse): We don't handle copying packets with a partial body length to an output stream. If this occurs, log an error and abort. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common: Check parameters more rigorously.Neal H. Walfield2015-08-211-0/+8
| | | | | | | | | * g10/parse-packet.c (dbg_copy_all_packets): Check that OUT is not NULL. (copy_all_packets): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common: Don't continuing processing on error.Neal H. Walfield2015-08-211-4/+4
| | | | | | | | | | | * g10/parse-packet.c (dbg_parse_packet): Also return if parse returns an error. (parse_packet): Likewise. (dbg_search_packet): Likewise. (search_packet): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common: Better respect the packet's length when reading it.Neal H. Walfield2015-08-211-9/+27
| | | | | | | | | * g10/parse-packet.c (parse_signature): Make sure PKTLEN doesn't underflow. Be more careful that a read doesn't read more data than PKTLEN says is available. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* doc: Remove C++ style comments and update HACKING.Werner Koch2015-08-202-13/+37
| | | | --
* po: Add lost translation of validity strings.Werner Koch2015-08-203-55/+62
| | | | | | | | | | * po/POTFILES.in (trust.c): Add missing file. * po/de.po: Changed German validity strings. * doc/help.de.txt: Ditto. -- Note that I replaced "uneingeschränkt" in de.po to "ultimativ" to make the output better readable.
* g10/parse-packet.c:parse: Try harder to not ignore an EOF.Neal H. Walfield2015-08-201-6/+25
| | | | | | | | * g10/parse-packet.c (parse): Be more robust: make sure to process any EOF. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* g10/parse-packet.c: Replace literal with symbolic expression.Neal H. Walfield2015-08-201-3/+3
| | | | | | | | * g10/parse-packet.c (dump_hex_line): Use sizeof rather than the buffer's size. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* Add documentation for g10/parse-packet.c.Neal H. Walfield2015-08-202-19/+223
| | | | | | | | | * g10/packet.h: Add documentation for functions defined in parse-packet.c. * g10/parse-packet.c: Improve comments for many functions. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* g10/packet.h: Remove unused argument from enum_sig_subpkt.Neal H. Walfield2015-08-202-8/+6
| | | | | | | | | | | | | * g10/packet.h (enum_sig_subpkt): Remove argument RET_N. Update callers. * g10/parse-packet.c (enum_sig_subpkt): Remove argument RET_N. -- Remove the RET_N argument, because it is unused and because it is meaningless: it's not clear whether it is an offset into SIG->HASHED or SIG->UNHASHED. Signed-off-by: Neal H. Walfield <[email protected]>.
* g10/parse-packet.c:mpi_read: Detect EOF and correct boundary conditions.Neal H. Walfield2015-08-201-8/+21
| | | | | | | | | * g10/parse-packet.c (mpi_read): Improve documentation. Correctly handle an EOF. On overflow, correctly return the number of bytes read from the pipeline. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Make control flow more obvious.Neal H. Walfield2015-08-201-73/+79
| | | | | | | | | | * common/iobuf.c (iobuf_read): Make control flow more obvious. (iobuf_get_filelength): Likewise. (iobuf_get_fd): Likewise. (iobuf_seek): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Add some sanity checks to catch programmer bugs.Neal H. Walfield2015-08-201-0/+42
| | | | | | | | | | | | | * common/iobuf.c (iobuf_alloc): Check that BUFSIZE is not 0. (iobuf_readbyte): Check that A is an input filter. Check that the amount of read data is at most the amount of buffered data. (iobuf_read): Check that A is an input filter. (iobuf_writebyte): Check that A is not an input filter. (iobuf_writestr): Check that A is not an input filter. (iobuf_flush_temp): Check that A is not an input filter. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c:iobuf_write_temp: Elide redundant code.Neal H. Walfield2015-08-201-4/+6
| | | | | | | | * common/iobuf.c (iobuf_write_temp): Don't repeat iobuf_flush_temp. Use it directly. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Have iobuf_writestr use iobuf_write, not iobuf_writebyteNeal H. Walfield2015-08-201-6/+1
| | | | | | | | * common/iobuf.c (iobuf_write): Don't write a byte at a time. Use iobuf_write. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf: Improve documentation and code comments.Neal H. Walfield2015-08-202-149/+530
| | | | | | | | common/iobuf.h: Improve documentation and code comments. common/iobuf.c: Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Adjust buffer size of filters in front of temp filters.Neal H. Walfield2015-08-201-2/+15
| | | | | | | | * common/iobuf.c (iobuf_push_filter2): If the head filter is a temp filter, use IOBUF_BUFFER_SIZE for the new filter. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Buffered data should not be processed by new filters.Neal H. Walfield2015-08-202-17/+116
| | | | | | | | | | | | * common/iobuf.c (iobuf_push_filter2): If the pipeline is an output or temp pipeline, the new filter shouldn't assume ownership of the old head's internal buffer: the data was written before the filter was added. * common/t-iobuf.c (double_filter): New function. (main): Add test cases for the above bug. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Flush the pipeline in iobuf_temp_to_buffer.Neal H. Walfield2015-08-201-1/+13
| | | | | | | | | * common/iobuf.c (iobuf_temp_to_buffer): Flush each filter in the pipeline and copy the data from the last (not the first) filter's internal buffer. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Combine iobuf_open, iobuf_create and iobuf_openrw.Neal H. Walfield2015-08-201-86/+55
| | | | | | | | | | * common/iobuf.c (do_open): New function, which is a generalization of iobuf_open, iobuf_Create, iobuf_openrw. (iobuf_open): Call do_open. (iobuf_create): Likewise. (iobuf_openrw): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.h: Remove iobuf_open_fd_or_name.Neal H. Walfield2015-08-204-22/+6
| | | | | | | | * common/iobuf.h (iobuf_open_fd_or_name): Remove prototype. Replace use with either iobuf_open or iobuf_fdopen_nc, as appropriate. * common/iobuf.c (iobuf_open): Remove function. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Rename iobuf_flush and make it a static function.Neal H. Walfield2015-08-202-17/+25
| | | | | | | | | | | * common/iobuf.h (iobuf_flush): Remove prototype. * common/iobuf.c (filter_flush): New static prototype. (iobuf_flush): Rename... (filter_flush): ... to this. Make static. Simplify code. Update callers. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Don't abort freeing a pipeline if freeing a filter failsNeal H. Walfield2015-08-201-5/+13
| | | | | | | | | * common/iobuf.c (iobuf_cancel): Don't abort freeing a pipeline if freeing a filter fails. This needs to a memory leak. Instead, keep freeing and return the error code of the first filter that fails. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Improve iobuf_peek.Neal H. Walfield2015-08-201-17/+33
| | | | | | | | | | | * common/iobuf.c (underflow): Take additional parameter clear_pending_eof. If not set, don't clear a pending eof when returning EOF. Update callers. (iobuf_peek): Fill the internal buffer, if needed, to be able to better satisfy any request. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: When requested, fill the buffer even if it is not empty.Neal H. Walfield2015-08-201-46/+92
| | | | | | | | * common/iobuf.c (underflow): Don't require that the buffer be empty. When called, fill any available space. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/t-iobuf.c: Add a test case for multiple EOFs.Neal H. Walfield2015-08-201-0/+93
| | | | | | | | common/t-iobuf.c (main): Add a test case for multiple EOFs in an INPUT pipeline. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Better respect boundary conditions in iobuf_read_line.Neal H. Walfield2015-08-204-21/+234
| | | | | | | | | | | | * common/iobuf.c (iobuf_read_line): Be more careful with boundary conditions. * common/iobuf.h: Include <gpg-error.h>. * common/t-iobuf.c: New file. * common/Makefile.am (module_tests): Add t-iobuf. (t_mbox_util_LDADD): New variable. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Fix filter type for iobuf_temp_with_content.Neal H. Walfield2015-08-201-1/+1
| | | | | | | | | * common/iobuf.c (iobuf_temp_with_content): Set the filter type to IOBUF_INPUT, not IOBUF_TEMP, which is only for output filters that write into a dynamic buffer. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.h: Remove unimplemented prototypes.Neal H. Walfield2015-08-201-3/+0
| | | | | | | | | * common/iobuf.h (iobuf_unread): Remove unimplemented prototype. (iobuf_clear_eof): Likewise. (iobuf_append): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* common/iobuf.c: Refactor code to not need the desc field.Neal H. Walfield2015-08-202-31/+29
| | | | | | | | | * common/iobuf.h (struct iobuf_struct): Remove field desc. * common/iobuf.c (iobuf_desc): New function. When a filter's description is needed, use this instead of the filter's desc field. -- Signed-off-by: Neal H. Walfield <[email protected]>.