Commit Graph

2819 Commits

Author SHA1 Message Date
Marcus Brinkmann
77a72c0d5e 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
	option to `ENCRYPT'.
	* engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
	successfully.
2001-12-13 22:12:06 +00:00
Marcus Brinkmann
4a55249ee6 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (close_notify_handler): New function.
	(_gpgme_gpgsm_new): Manage the file descriptors a
	bit differently.  Do not set close-on-exec flags.
	(_gpgme_gpgsm_op_decrypt): Do not set message_fd
	to -1, this is done by the close handler.
	(_gpgme_gpgsm_op_encrypt): Likewise.
	(_gpgme_gpgsm_op_import): Likewise (also for output_fd).
	(_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
	(_gpgme_gpgsm_op_sign): Likewise.
	(_gpgme_gpgsm_op_verify): Likewise, but for output_fd.

	* posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
	non-inherited file descriptor index of the pipe.
2001-12-13 22:02:08 +00:00
Marcus Brinkmann
831692ebf7 2001-12-13 Marcus Brinkmann <marcus@g10code.de>
* gpgsm/cert_dfn_pca01.der: New file.
	* gpgsm/cert_dfn_pca15.der: Likewise.
	* gpgsm/cert_g10code_test1.der: Likewise.
	* gpgsm/t-import.c: Likewise.
	* gpgsm/Makefile.am (EXTRADIST): Add new files.
	(TESTS): Add t-import.
2001-12-13 21:51:30 +00:00
Marcus Brinkmann
0dba5161e2 2001-12-13 Marcus Brinkmann <marcus@gnu.org>
* assuan-connect.c (assuan_pipe_connect): Remove code that closes
	all the little file descriptors we set up.
2001-12-13 21:38:11 +00:00
Marcus Brinkmann
05394e788e 2001-12-13 Marcus Brinkmann <marcus@gnu.org>
* assuan-buffer.c (assuan_read_line): Fix order of execution to
	get correct return values.
2001-12-13 20:13:34 +00:00
Werner Koch
3634edf055 * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
(gpgsm_status_handler): Pass datalines to a colon handler
* engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
handler for gpgsm.

* engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
pattern.
(gpgsm_assuan_simple_command): Removed underscore from
assuan_write_line.
(_gpgme_gpgsm_start): Ditto.
(gpgsm_assuan_simple_command): Replaced interal Assuan read
function by the new assuan_read_line.  Removed the use of the
internal header.
(gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
(_gpgme_gpgsm_start): Use the documented way to get an fd from
assuan.
2001-12-13 17:37:18 +00:00
Werner Koch
b41d06c0a1 * assuan-handler.c (assuan_get_active_fds): Fixed silly bug,
pretty obvious that nobody ever tested this function.
2001-12-13 17:37:04 +00:00
Karl-Heinz Zimmer
cfcac3496a improce memory handling 2001-12-13 15:13:09 +00:00
Werner Koch
9f84291722 .cvsigore updated - I still not tyhing they should go innto the cvs 2001-12-13 15:07:59 +00:00
Werner Koch
4922297af1 Set protocol to CMS to test gpgsm 2001-12-13 15:06:56 +00:00
Werner Koch
0b11af59c7 * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
pattern.
(gpgsm_assuan_simple_command): Removed underscore from
assuan_write_line.
(_gpgme_gpgsm_start): Ditto.
* keylist.c (keylist_colon_handler): Handle "crt" records
* key.h (gpgme_key_s): Add an x509 flag.
* key.c (parse_x509_user_id): New.
(_gpgme_key_append_name): Handle x.509 names.

However, it does not yet work.
2001-12-13 15:05:35 +00:00
Werner Koch
3de2384ea5 Updated Assuan to the current version 2001-12-13 15:04:36 +00:00
Werner Koch
70720764e1 *** empty log message *** 2001-12-13 13:24:33 +00:00
Karl-Heinz Zimmer
bc11308fa3 Corrected (for a second time) code status error from previous wrong CVS comits 2001-12-06 17:19:07 +00:00
Karl-Heinz Zimmer
08debc7ab2 Corrected code status error from previous wrong CVS comits 2001-12-06 16:59:09 +00:00
Marcus Brinkmann
8cd3d96f2d 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): Make it work with current
	version of assuan.
2001-12-05 20:38:50 +00:00
Marcus Brinkmann
62d0374e72 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
	(_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
	output descriptor.
	(_gpgme_gpgsm_op_sign): Likewise.
2001-12-05 20:37:37 +00:00
Marcus Brinkmann
ba1e19e10b Add .cvsignore files. Suggested by Jan-Oliver Wagner <jan@intevation.de>. 2001-12-05 19:50:45 +00:00
Marcus Brinkmann
e9ece11e83 2001-12-05 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
	occurs.
2001-12-05 13:23:59 +00:00
Marcus Brinkmann
e0da4fbd31 2001-11-29 Marcus Brinkmann <marcus@g10code.de>
* gpgmeplug.c (checkMessageSignature): Add call to gpgme_set_protocol.
2001-12-05 13:21:04 +00:00
Karl-Heinz Zimmer
ee33d9f146 added error detection to signing and encrypting methodes: this has to be improved furtheron 2001-11-29 12:29:55 +00:00
Matthias Kalle Dalheimer
4dcc18b102 Check for out-of-memory in signature verification 2001-11-26 16:43:00 +00:00
Karl-Heinz Zimmer
86490c114b enabled fetching meta data after checking of signature(s) 2001-11-26 15:54:12 +00:00
Marcus Brinkmann
a8c76a0f83 2001-11-26 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
2001-11-23  Marcus Brinkmann  <marcus@g10code.de>
2001-11-26 11:41:17 +00:00
Matthias Kalle Dalheimer
a0f861940e Filling the SignatureMetaData struct (the crucial code is #ifdef'd out for safety's sake)
Changes to SignatureMetaData
Added SignatureMetaDataExtendedInfo
2001-11-25 21:53:39 +00:00
Karl-Heinz Zimmer
aa51d5af33 changed specification of SignatureMetaData struct 2001-11-25 20:31:36 +00:00
Karl-Heinz Zimmer
9e24b66475 [Kalle] signature verification and decoding of encrypted mails 2001-11-25 15:23:21 +00:00
Karl-Heinz Zimmer
14aa91a95b Now gpgmeplug.c can also create encrypted and signed+encrypted S/MIME mails. 2001-11-25 05:07:44 +00:00
Karl-Heinz Zimmer
49b7969a49 adjusted 'encryptMessage' parameters: now also the addressee is given 2001-11-25 03:37:13 +00:00
Werner Koch
4e56c2dddd Guess what. 2001-11-24 21:27:22 +00:00
Werner Koch
dc8410cbcf Updated from canonical source location in GnuPG. 2001-11-24 21:22:18 +00:00
Marcus Brinkmann
a22eef99a2 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
	Deal with assuan read line returning more than one line (for now).
2001-11-24 19:31:26 +00:00
Marcus Brinkmann
46bb2a4470 2001-11-24 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (libgpgsmplug_la_SOURCES): Fix source file.
2001-11-24 17:11:15 +00:00
Karl-Heinz Zimmer
83855db196 signing now returns only the SIGNATURE - not the original text - since building of the S/MIME object is done in the calling program (the MUA...) 2001-11-24 10:51:55 +00:00
Marcus Brinkmann
8c3726d634 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
	the current protocol definition.
2001-11-23 11:52:09 +00:00
Karl-Heinz Zimmer
64da5fc845 signing of mail bodies is working now - buuuuut: I changed the behaviour of the 'signMessage()' function, it now returns *only* the signature part (with a trailing zero). This is neccessary to avoid confugion at the KMail side: otherwise KMail might try to convert the whole MIME block into quoted printable - of course this is only allowed for the body part but not for the signature part. 2001-11-23 02:08:53 +00:00
Marcus Brinkmann
09b1be8339 Explain more of the build system. 2001-11-23 01:12:04 +00:00
Marcus Brinkmann
662f9b185b 2001-11-23 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
	ends of the pipe.
2001-11-23 00:48:51 +00:00
Marcus Brinkmann
d1ded512c4 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c: Include stdlib.h and string.h.  Also include,
	for now, rungpg.h and status-table.h.
	(gpgsm_status_handler): Implement more of the status handler.
2001-11-22 21:27:41 +00:00
Marcus Brinkmann
884de0606b 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
	(_gpgme_engine_op_delete): Likewise.
	(_gpgme_engine_op_encrypt): Likewise.
	(_gpgme_engine_op_export): Likewise.
	(_gpgme_engine_op_genkey): Likewise.
	(_gpgme_engine_op_keylist): Likewise.
	(_gpgme_engine_op_sign): Likewise.
	(_gpgme_engine_op_trustlist): Likewise.

	* engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
	(gpgsm_assuan_simple_command): Likewise.
	(gpgsm_set_recipients): Likewise.
	(gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
	(_gpgme_gpgsm_op_delete): New function.
	(_gpgme_gpgsm_op_export): Likewise.
	(_gpgme_gpgsm_op_genkey): Likewise.
	(_gpgme_gpgsm_op_sign): Likewise.
	(_gpgme_gpgsm_op_keylist): Likewise.
	(_gpgme_gpgsm_op_trustlist): Likewise.
	(_gpgme_gpgsm_release): Release command.
	(_gpgme_gpgsm_op_decrypt): Allocate command.
	(_gpgme_gpgsm_op_import): Likewise.
	(gpgsm_status_handler): Also treat `ERR' strings as EOF.
2001-11-22 20:48:37 +00:00
Marcus Brinkmann
8993173dfb 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (gpgme_set_protocol): New prototype.

2001-11-22  Marcus Brinkmann  <marcus@g10code.de>

	* Makefile.am (libgpgsmplug_la_LIBADD): New variable.
	(libgpgsmplug_la_LDFLAGS): Likewise.
	(libgpgsmplug_la_SOURCES): Likewise.
	(lib_LTLIBRARIES): Add libgpgsmplug.la.
	(INCLUDES): Include the local gpgme.h.

	* gpgmeplug.c (signMessage): Set protocol.
	(GPGMEPLUG_PROTOCOL) [!GPGMEPLUG_PROTOCOL]: Set
	GPGMEPLUG_PROTOCOL.
	* gpgsmplug.c: New file.
2001-11-22 18:48:53 +00:00
Karl-Heinz Zimmer
c703e0c27e removed stupid C bug (malloc of strlen(..) instead of 1+strlen) 2001-11-22 17:32:21 +00:00
Marcus Brinkmann
6290f74605 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
	(_gpgme_gpgsm_op_import): Likewise.
2001-11-22 15:22:27 +00:00
Marcus Brinkmann
c23a9b5e74 2001-11-22 Marcus Brinkmann <marcus@gnu.org>
* engine-gpgsm.c: Shuffle around header inclusion a bit, to still
	keep them seperate.
	(_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
2001-11-22 13:47:46 +00:00
Werner Koch
9ece643cba * engine-gpgsm.c: Include more headers so that NULL and mk_error
is defined even with an undefined GPGSM_PATH.
2001-11-22 10:29:52 +00:00
Karl-Heinz Zimmer
66f4b09b45 Now send the signature back to the calling function (instead of just printing it to stdout) 2001-11-22 09:36:53 +00:00
Marcus Brinkmann
679d5c2b49 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
	gpg_outbound_handler): Moved to ...
	* data.c (_gpgme_data_inbound_handler, write_mem_data,
	write_cb_data, _gpgme_data_outbound_handler): ... here.  Make the
	_gpgme_* ones non-static.
	* data.c: Include io.h.

	* ops.h (_gpgme_data_inbound_handler): New prototype.
	(_gpgme_data_outbound_handler): Likewise.
	(_gpgme_gpg_spawn): Use these new functions.

	* engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
	_gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
	_gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
	_gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
	_gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
	_gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
	Include <rungpg.h> for status handler function.

	* engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
	input_data, output_fd, output_data, message_fd, message_data, command
	and status.
	(_gpgme_gpgsm_new): Open input, output and message pipes before
	connecting to the client.  Close server's ends afterwards.
	(_gpgme_gpgsm_release): Close open file descriptors.  Remove
	server process from wait queue.
	(_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
	_gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.

	* engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
	(_gpgme_engine_set_status_handler): Likewise.
	(_gpgme_engine_op_verify): Likewise.
2001-11-22 03:08:58 +00:00
Marcus Brinkmann
3f1c299866 * assuan-connect.c (assuan_get_pid): New function.
* assuan.h: Prototype.  Include sys/types.h for pid_t,
	and stdio.h for FILE *.
2001-11-22 03:08:07 +00:00
Marcus Brinkmann
862ef3cf1c 2001-11-22 Marcus Brinkmann <marcus@g10code.de>
* configure.ac (AC_CONFIG_FILES): Add tests/gpg/Makefile and
	tests/gpgsm/Makefile.
2001-11-22 03:07:10 +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