Commit Graph

18 Commits

Author SHA1 Message Date
Werner Koch
8d91c0f4cd
Add SPDX identifiers to most source files
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2018-11-16 13:27:33 +01:00
Werner Koch
0c1244a2b7
core: Also check for a failed selftest in gpgm_data_new.
* src/data.c (_gpgme_data_new): Check for failed selftest.
* tests/run-support.h (make_filename): Print a message on mallooc
failure.
(init_gpgme_basic): New.
* tests/run-identify.c (main): Call init_gpgme_basic becuase we do not
need to setup a protocol.
* tests/t-data.c: Define PGM and include run-support.h.
(make_filename): Remove.
(main): Call init_gpgme_basic.
--

Note: This patch may break applications which used gpgme_data but no
gpgme_new without having called the required gpgme_check_version.

GPGME can be used without a protocol for example to work with the data
object abstraction.  Thus a call to gpgme_data_new also needs to check
the result of the core selftests - including on whether
gpgme_check_version has been called.

Signed-off-by: Werner Koch <wk@gnupg.org>
2017-12-04 12:08:31 +01:00
Werner Koch
9064eebdc0
tests: Mark lots of unused vars and fix const mismatches.
Signed-off-by: Werner Koch <wk@gnupg.org>
2016-09-13 20:48:06 +02:00
Justus Winter
62d10c2a38 tests: Fix trivial memory leaks.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-06-27 18:14:02 +02:00
Justus Winter
8c61cbfb8f Fix typos found by codespell.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2015-12-02 11:28:07 +01:00
Werner Koch
139e798c87 Remove all trailing whitespace from source files
--
Command used:  sed -i 's,[ \t]*$,,' FILE
2012-09-25 15:29:49 +02:00
Marcus Brinkmann
dae3073aaa Use gpgme interface for error handling to avoid linking with gpg-error.
* tests/t-data.c, tests/run-export.c, tests/run-keylist.c,
tests/run-support.h, tests/run-verify.c, tests/gpg/t-decrypt-verify.c,
tests/gpg/t-edit.c, tests/gpg/t-eventloop.c, tests/gpg/t-keylist-sig.c,
tests/gpg/t-keylist.c, tests/gpg/t-support.h, tests/gpg/t-trustlist.c,
tests/gpg/t-verify.c, tests/gpg/t-wait.c, tests/gpgsm/cms-decrypt.c,
tests/gpgsm/cms-keylist.c, tests/gpgsm/t-keylist.c,
tests/gpgsm/t-support.h, tests/gpgsm/t-verify.c,
tests/opassuan/t-command.c: Use gpgme interface for gpg-error functions.
2012-02-08 15:26:17 +01:00
Marcus Brinkmann
71775ad8fc 2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
	COPYING.
	* COPYING.LESSER: New file.
	* gpgme.spec.in (%doc): Add COPYING.LESSER.
	* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
	2.1 or later.
	* TODO: Add copyright notice.
	* README.CVS: Likewise.

assuan/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* README.1st: Add copyright notice.

doc/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am: Change license to LGPL.
	(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.

	* gpgme.texi: Change license to LGPL (also for documentation of
	GPGME's license).
	* lesser.texi: New file.
	* gpl.texi: File removed.

gpgme/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* putc_unlocked.c, funopen.c: I just claim copyright on these
	files and change their license to LGPL, because they are totally
	trivial wrapper functions.
	* isascii.c: Change copyright notice to the one from ctype/ctype.h
	in the GNU C Library (CVS Head 2004-10-10), where isascii is
	defined as a macro doing exactly the same as the function in this
	file.
	* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
	* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
	* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
	ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
	data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
	data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
	decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
	engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
	export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
	key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
	passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
	rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
	util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
	wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
	license to LGPL.

tests/
2004-12-07  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/mkdemodirs: Add copyright notice.

	* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
	gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
	gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
	gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
	gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
	gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
	gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
	gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
	gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
	gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
	t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
Werner Koch
91d3e5aa57 * gpgsm/t-import.c (check_result): gpgsm does now return info in
the result->imports; adjust for that.

* gpgsm/Makefile.am (TESTS_ENVIRONMENT): Reset the GPG_AGENT_INFO.

* gpg/t-keylist-sig.c (main): s/class/sig_class/.
* gpg/t-signers.c (check_result): Ditto.
* gpg/t-sign.c (check_result): Ditto.
* gpg/t-encrypt-sign.c (check_result): Ditto.
* gpgsm/t-sign.c (check_result): Ditto.
2004-02-17 17:26:20 +00:00
Marcus Brinkmann
51c384409e 2003-07-31 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-verify.c (check_result): Change type of SUMMARY to
	unsigned int.
	* gpg/t-decrypt-verify.c (check_verify_result): Likewise.
	* gpg/t-keylist-sig.c (keys): Change type of member CLASS to
	unsigned int.
	* t-data.c (read_cb): Change type of AMOUNT to unsigned int.
	* t-version.c (version): Remove unused variable.
2003-07-31 15:44:32 +00:00
Marcus Brinkmann
02536bb72b doc/
2003-06-06  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi: Change error codes to GPG_ERR_* variants.
	(Error Handling): Rewritten.

gpgme/
2003-06-05  Marcus Brinkmann  <marcus@g10code.de>

	Everywhere: Use libgpg-error error codes.

	* Makefile.am (EXTRA_DIST): Remove mkerrors.
	(BUILT_SOURCES): Remove errors.c.
	(MOSTLYCLEANFILES): Likewise.
	(libgpgme_la_SOURCES): Likewise.  Add error.c.
	(errors.c): Remove target.
	* mkerrors: File removed.
	* error.c: New file.

	* gpgme.h (gpgme_error_t): Change to type gpg_error_t.
	(gpgme_err_code_t, gpgme_err_source_t): New types.
	(gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
	New static inline functions.
	(gpgme_strsource, gpgme_err_code_from_errno,
	gpgme_err_code_to_errno, gpgme_err_make_from_errno,
	gpgme_error_from_errno): New prototypes.

tests/
2003-06-06  Marcus Brinkmann  <marcus@g10code.de>

	Everywhere: Use libgpg-error error codes.

	* gpg/Makefile.am (noinst_HEADERS): New variable.
	* gpg/t-support.h: New file.
	* gpgsm/Makefile.am (noinst_HEADERS): New variable.
	* gpgsm/t-support.h: New file.
2003-06-05 23:20:29 +00:00
Marcus Brinkmann
0a1940070d 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
* t-data.c: Remove TEST_OUT_CB.
	(main): Likewise.
	* gpg/t-trustlist.c (main): Access ITEM directly.
2003-05-27 03:06:37 +00:00
Marcus Brinkmann
0a882398e1 2003-05-18 Marcus Brinkmann <marcus@g10code.de>
In all files, replace the Gpgme* type names with the new gpgme_*
	type names.

doc/
2003-05-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.texi (Header): Remove Gpgme as namespace prefix.  Add
	_GPGME to namespace prefix.
	* gpgme.texi (Multi Threading): Add note about link order.

gpgme/
2003-05-18  Marcus Brinkmann  <marcus@g10code.de>

	* gpgme.h: The following types are renamed.  The old name is kept
	as a deprecated typedef.
	(GpgmeCtx): Rename to gpgme_ctx_t.
	(GpgmeData): Rename to gpgme_data_t.
	(GpgmeRecipients): Rename to gpgme_recipients_t.
	(GpgmeError): Rename to gpgme_error_t.
	(GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
	(GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
	(GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
	(GpgmeSigStat): Rename to gpgme_sig_stat_t.
	(GpgmeSigMode): Rename to gpgme_sig_mode_t.
	(GpgmeAttr): Rename to gpgme_attr_t.
	(GpgmeValidity): Rename to gpgme_validity_t.
	(GpgmeProtocol): Rename to gpgme_protocol_t.
	(GpgmeStatusCode): Rename to gpgme_status_code_t.
	(GpgmeEngineInfo): Rename to gpgme_engine_info_t.
	(GpgmeSubkey): Rename to gpgme_subkey_t.
	(GpgmeKeySig): Rename to gpgme_keysig_t.
	(GpgmeUserID): Rename to gpgme_user_id_t.
	(GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
	(GpgmeProgressCb): Rename to gpgme_progress_cb_t.
	(GpgmeEditCb): Rename to gpgme_edit_cb_t.
	(GpgmeIOCb): Rename to gpgme_io_cb_t.
	(GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
	(GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
	(GpgmeEventIO): Rename to gpgme_event_io_t.
	(GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
	(GpgmeIOCbs): Rename to gpgme_io_cbs.
	(gpgme_io_cbs_t): New type.
	(GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
	(GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
	(GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
	(GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
	(GpgmeDataCbs): Rename to gpgme_data_cbs.
	(gpgme_data_cbs_t): New type.
	(GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
	(GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
	(GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
	(GpgmeNewSignature): Rename to gpgme_new_signature_t.
	(GpgmeSignResult): Rename to gpgme_sign_result_t.
	(GpgmeSigNotation): Rename to gpgme_sig_notation_t.
	(GpgmeSignature): Rename to gpgme_signature_t.
	(GpgmeVerifyResult): Rename to gpgme_verify_result_t.
	(GpgmeImportStatus): Rename to gpgme_import_status_t.
	(GpgmeImportResult): Rename to gpgme_import_result_t.
	(GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
	(GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
	(GpgmeTrustItem): Rename to gpgme_trust_item_t.
	* gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
	GPGME_No_Recipients, GPGME_Invalid_Recipient and
	GPGME_No_Passphrase.
	* data.h (struct gpgme_data_s): Rename to struct gpgme_data.
	* context.h (struct gpgme_context_s): Rename to struct
	gpgme_context.
	(struct gpgme_recipients_s): Rename to gpgme_recipients.
2003-05-18 20:45:24 +00:00
Marcus Brinkmann
0447e0dd6d gpgme/
2002-10-08  Marcus Brinkmann  <marcus@g10code.de>

	New data object component:

	* gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
	GpgmeDataReleaseCb): New types.
	(struct GpgmeDataCbs): New structure.
	(gpgme_data_read): Changed prototype to match that of read() closely.
	(gpgme_data_write): Similar for write().
	(gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
	gpgme_data_new_from_stream): New prototypes.
	(gpgme_data_get_type, gpgme_check_engine): Prototype removed.

	* Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
	data-stream.c, data-mem.c, data-user.c and data-compat.c.
	* data.c: Reimplemented from scratch.
	* (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
	data-user.c): New file.
	* context.h (struct gpgme_data_s): Removed.
	* conversion.c: Include <errno.h> and <sys/types.h>.
	(_gpgme_data_append): New function.
	* data.c (_gpgme_data_append_string): Move to ...
	* conversion.c (_gpgme_data_append_string): ... here.
	* data.c (_gpgme_data_append_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_for_xml): ... here.
	* data.c (_gpgme_data_append_string_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_string_for_xml): ... here.
	* data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
	* conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.

	* ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
	removed.
	* types.h (GpgmeDataMode): Type removed.

	* decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
	* edit.c (_gpgme_op_edit_start): Likewise.
	* encrypt.c (_gpgme_op_encrypt_start): Likewise.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
	* encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
	* export.c (_gpgme_op_export_start): Likewise.
	* genkey.c (_gpgme_op_genkey_start): Likewise.
	* import.c (_gpgme_op_import_start): Likewise.
	* sign.c (_gpgme_op_sign_start): Likewise.
	* verify.c (_gpgme_op_verify_start): Likewise.

	* encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
	no recipient if no data was returned.
	* encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
	no recipient if no data was returned.
	* encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
	no recipient if no data was returned.

	* engine.c (_gpgme_engine_op_verify): Add new argument to
	differentiate detached from normal signatures.
	* engine.h (_gpgme_engine_op_verify): Likewise for prototype.
	* engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.  Don't check
	mode of data argument.
	* engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
	* gpgme.h (gpgme_op_verify_start): Likewise for prototype.
	(gpgme_op_verify): Likewise for prototype.
	* rungpg.c (_gpgme_gpg_op_verify): Likewise.
	* rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
	* verify.c (_gpgme_op_verify_start): Likewise.
	(gpgme_op_verify_start): Likewise.
	(gpgme_op_verify): Likewise.

	* rungpg.c (struct arg_and_data_s): New member INBOUND to hold
	direction of data object.
	(_gpgme_gpg_add_data): Add new argument INBOUND.  Use it to
	determine direction of data object.
	(_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
	_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
	_gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
	_gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
	_gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
	invocation.
	(build_argv): Use new member INBOUND to determine direction of
	file descriptor.  Don't check the data type.
	* rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.

	* gpgme.c (gpgme_get_op_info): Don't call
	_gpgme_data_get_as_string if CTX->op_info is NULL.

	* version.c (gpgme_check_engine): Function removed.


tests/
2002-10-09  Marcus Brinkmann  <marcus@g10code.de>

	* gpg/t-decrypt.c (print_data): Update to new gpgme_data_read
	interface, and use gpgme_engine_check_version instead
	gpgme_check_version.
	* gpg/t-decrypt-verify.c (print_data): Likewise.
	* gpg/t-edit.c (main): Likewise.
	* gpg/t-encrypt.c (print_data): Likewise.
	* gpg/t-encrypt-sign.c (print_data): Likewise.
	* gpg/t-encrypt-sym.c (print_data): Likewise.
	* gpg/t-eventloop.c (print_data): Likewise.
	* gpg/t-export.c (print_data): Likewise.
	* gpg/t-sign.c (print_data): Likewise.
	* gpg/t-signers.c (print_data): Likewise.
	* gpgsm/t-decrypt.c (print_data): Likewise.
	* gpgsm/t-encrypt.c (print_data): Likewise.
	* gpgsm/t-export.c (print_data): Likewise.
	* gpgsm/t-sign.c (print_data): Likewise.
	* gpg/t-verify.c (main): Likewise for gpgme_op_verify.
	* gpgsm/t-verify.c (main): Likewise for gpgme_op_verify.
	* t-data.c (read_once_test): Likewise.
	(write_test): Update for new behaviour of data objects.
	(main): Remove type test.
2002-10-09 00:16:38 +00:00
Marcus Brinkmann
790a8e192f 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* gpg/: New directory.
	* Makefile.am, t-verify.c, t-encrypt.c, t-signers.c, t-trustlist.c,
	t-sign.c, t-keylist.c, t-import.c, t-genkey.c, t-export.c,
	t-decrypt-verify.c, t-decrypt.c, t-version.c, t-data.c, mkdemodirs.
	cipher-1.asc, cipher-2.asc, geheim.txt, pubdemo.asc, pubkey-1.asc,
	secdemo.asc, seckey-1.asc): Move to sub directory gpg/.

	* gpg/Makefile.am (INCLUDES): Include gpgme/, not include/ and
	intl/.
	(LDD): Correct relative path to gpgme library.
	(TESTS): Remove t-version and t-data.
	* gpg/t-verify.c, gpg/t-encrypt.c, gpg/t-signers.c, gpg/t-trustlist.c,
	gpg/t-sign.c, gpg/t-keylist.c, gpg/t-import.c, gpg/t-genkey.c,
	gpg/t-export.c, gpg/t-decrypt-verify.c, gpg/t-decrypt.c,
	t-version.c, t-data.c): Include gpgme.h, not "../gpgme/gpgme.h".

	* Makefile.am: New file.
	* gpgsm/: New directory.
	* gpgsm/Makefile.am: New file.
2001-11-22 03:01:26 +00:00
Marcus Brinkmann
1ecdde3ced gpgme/
2001-11-02  Marcus Brinkmann  <marcus@g10code.de>

	* rungpg.c (pipemode_copy): Change type of NBYTES to size_t.

	* key.c: Include string.h.
	* data.c: Likewise.
	* recipient.c: Likewise.

tests/
2001-11-02  Marcus Brinkmann  <marcus@g10code.de>

	* t-data.c: Include stddef.h.
	(read_once_test): Change type of READ to size_t.
	(read_test): Likewise.
	(write_test): Likewise.
2001-11-02 15:51:15 +00:00
Marcus Brinkmann
d4fb115bda 2001-10-22 Marcus Brinkmann <marcus@g10code.de>
* t-data.c (write_test): New function.
	(main): Invoke write_test for all rounds except TEST_OUT_CB.
2001-10-22 14:19:25 +00:00
Marcus Brinkmann
f83651e0a5 2001-10-16 Marcus Brinkmann <marcus@g10code.de>
* t-version.c: New file.
	* t-data.c: Likewise.
	* t-data-1.txt: Likewise.
	* t-data-2.txt: Likewise.
	* Makefile.am (TESTS): Add t-version, t-data.
2001-10-17 19:17:46 +00:00