Commit Graph

43 Commits

Author SHA1 Message Date
924d62f6d8 Pass --always-trust to gpg (requested by users). (pgp_clearsign): Same.
2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_sign): Pass --always-trust to gpg
	(requested by users).
	(pgp_clearsign): Same.
	(pgp_encrypt): Here too.

svn path=/trunk/; revision=15731
2002-02-14 23:44:21 +00:00
081f6dbb1b Protect against either of the types being NULL.
2001-12-04  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-utils.c (header_content_type_simple): Protect against
	either of the types being NULL.

2001-12-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-mime-filter-basic.c (filter): If complete() allocates
	len+2 bytes for the out buffer, so should this. See bug #16371 for
	an example case.

2001-12-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-sasl-digest-md5.c: iconv() returns a size_t, not an int.

	* camel-pgp-context.c: The return value of iconv() is a size_t,
	not an int.

	* camel-mime-part-utils.c (convert_buffer): Always use size_t args
	for iconv().

	* camel-mime-filter-charset.c (complete): Always use size_t args
	for iconv().
	(filter): Same.

	* camel-mime-utils.c (header_address_fold): Make headerlen a
	size_t instead of an int.
	(header_fold): Same.
	(base64_encode_close): We should be returning a size_t and inlen
	should also be a size_t.
	(base64_encode_step): Same here.
	(base64_decode_step): Here too.
	(base64_encode_simple): And here...
	(base64_decode_simple): Same.
	(uuencode_close): We should also use size_t's here...
	(uuencode_step): And here too.
	(uudecode_step): And also here.
	(quoted_encode_close): Same idea here.
	(quoted_encode_step): Again here.
	(quoted_decode_step): Here too.
	(quoted_encode): Input length should be a size_t.
	(rfc2047_decode_word): Same.
	(g_string_append_len): Here too.
	(append_8bit): "
	(rfc2047_encode_word): "
	(quote_word): "
	(hex_decode): "
	(rfc2184_decode): Use size_t's with iconv().
	(header_decode_param): Same.

svn path=/trunk/; revision=14956
2001-12-10 19:14:32 +00:00
7d2baffd50 If any of the pipe()'s fail, clean up any pipes that may have succeeded.
2001-11-08  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): If any of the
	pipe()'s fail, clean up any pipes that may have succeeded. Also
	close the password fds.

svn path=/trunk/; revision=14649
2001-11-09 22:00:54 +00:00
44f724adfe Notify the user that PGP 2.6.x is no longer supported and use
2001-10-29  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_sign): Notify the user that PGP 2.6.x
	is no longer supported and use camel_exception_set() instead of
	setv() where appropriate.
	(pgp_clearsign): Same.
	(pgp_verify): And again here.
	(pgp_encrypt): Here too.
	(pgp_decrypt): And finally here.

svn path=/trunk/; revision=14349
2001-10-29 18:40:12 +00:00
42606efd98 More fixing of the license texts.
svn path=/trunk/; revision=14216
2001-10-27 18:06:04 +00:00
5
5b449d9ca7 Remove the stupid warning that should never have been there in the first
2001-10-25    <NotZed@Ximian.com>

        * camel-search-private.c (utf8_get): Remove the stupid warning
        that should never have been there in the first place.

        * camel-sasl-digest-md5.c (digest_response): s/iconv/e_iconv/

        * camel-pgp-context.c (pgp_verify): "

        * camel-mime-utils.c (rfc2047_decode_word, rfc2047_decode_word,
        append_8bit, rfc2047_encode_word, rfc2184_decode,
        header_decode_param): "

        * camel-mime-part-utils.c (convert_buffer, convert_buffer): "

        * camel-mime-filter-charset.c (reset, complete, filter): "

svn path=/trunk/; revision=14113
2001-10-26 00:37:52 +00:00
b80a058e55 If we are kludging around a inline-pgp signed part, do some charset
2001-10-22  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-mime.c (camel_pgp_mime_part_verify): If we are
	kludging around a inline-pgp signed part, do some charset
	conversion to protect any 8bit text.

svn path=/trunk/; revision=13896
2001-10-22 21:50:21 +00:00
ae6f93814a Make sure the cancel_fd isn't -1.
2001-10-18  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): Make sure the
	cancel_fd isn't -1.

svn path=/trunk/; revision=13781
2001-10-19 00:30:36 +00:00
20d53760e9 Make user-cancellable.
2001-10-18  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): Make
	user-cancellable.

svn path=/trunk/; revision=13778
2001-10-18 22:48:26 +00:00
4d00a548d0 Rearange the order of the gpg options slightly otherwise it might try to
2001-10-16  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Rearange the order of the gpg
	options slightly otherwise it might try to use "--no-tty" as the
	filename to verify :-)

svn path=/trunk/; revision=13714
2001-10-17 00:12:33 +00:00
1
a5fa3f992d Removed charset/locale charset lookup and iconv_open/close functions,
2001-10-11    <NotZed@Ximian.com>

        * camel-charset-map.[ch]: Removed charset/locale charset lookup
        and iconv_open/close functions, moved to gal.  Fixed all callers.

svn path=/trunk/; revision=13602
2001-10-11 22:08:20 +00:00
2
65014a74aa Change to camel_charset_iconv_open/close.
2001-10-02    <NotZed@Ximian.com>

        * camel-sasl-digest-md5.c (digest_response):  Change to
        camel_charset_iconv_open/close.

        * camel-pgp-context.c (pgp_verify): Change to
        camel_charset_iconv_open/close.

        * camel-mime-part-utils.c (convert_buffer): Change to
        camel_charset_iconv_open().

        * camel-mime-filter-charset.c
        (camel_mime_filter_charset_new_convert, finalise): Change to
        camel_charset_iconv_open, etc.

        * camel-mime-utils.c: Use the camel_charset_iconv_open/close()
        functions to open/close it.

        * camel-charset-map.c (camel_charset_iconv_open): New function,
        wrap iconv_open, so we can cache ic's.
        (camel_charset_iconv_close): Likewise for close.
        (camel_charset_map_init,shutdown): Init/free iconv cache.

svn path=/trunk/; revision=13361
2001-10-03 00:12:49 +00:00
b940ba617f Add --no-secmem-warning and --no-greeting to the gpg command-line options.
2001-09-29  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_sign): Add --no-secmem-warning and
	--no-greeting to the gpg command-line options.
	(pgp_clearsign): Same.
	(pgp_verify): Here too.
	(pgp_encrypt): And here.
	(pgp_decrypt): And finally here.

svn path=/trunk/; revision=13251
2001-09-29 23:47:04 +00:00
99949cdd39 No longer takes a remember argument. (pgp_sign): Only uncache the
2001-09-25  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (camel_pgp_context_new): No longer takes a
	remember argument.
	(pgp_sign): Only uncache the passphrase on failure.
	(pgp_clearsign): Same.
	(pgp_encrypt): Here too.
	(pgp_decrypt): And here.
	(pass_free): New function to zero the passphrase before freeing
	it.

svn path=/trunk/; revision=13138
2001-09-26 00:08:17 +00:00
1df3e6787e Don't even try to alert the user if the session isn't interactive.
2001-09-23  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-openssl.c (ssl_verify): Don't even try to alert
	the user if the session isn't interactive.
	(errlib_error_to_errno): Make the default errno EINTR so that we
	act just like CamelTcpStreamSSL.

	* camel-pgp-context.c (pgp_sign): When the password is not
	provided, set the exception to USER_CANCEL.
	(pgp_clearsign): Same.
	(pgp_encrypt): And here.
	(pgp_decrypt): Here too.

svn path=/trunk/; revision=13088
2001-09-23 22:41:54 +00:00
22e5de2923 Updated exception strings to be more clear.
2001-09-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c: Updated exception strings to be more clear.

	* camel-pgp-mime.c (pgp_mime_part_sign_restore_part): Stupid
	mistake, fixes bug #9975.

svn path=/trunk/; revision=13001
2001-09-20 00:37:10 +00:00
6095ecfc4b Return -1 on failure.
2001-09-13  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): Return -1 on
	failure.

svn path=/trunk/; revision=12799
2001-09-13 16:16:39 +00:00
cc3ec1cb48 Initialize buf and diag_buf to NULL, hopefully this fixes the crash if the
2001-08-28  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): Initialize buf
	and diag_buf to NULL, hopefully this fixes the crash if the
	select() times out.
	(pgp_encrypt): Argh. What was I thinking? Don't use "-r recipient"
	as an argument, instead use "-r" and "recipient" as 2 separate
	arguments to pgp. This might fix the "gpg only encrypts to my
	private key" bug?

svn path=/trunk/; revision=12510
2001-08-29 03:16:57 +00:00
572e564845 Initialize buf and diag_buf to NULL, hopefully this fixes the crash if the
2001-08-28  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): Initialize buf
	and diag_buf to NULL, hopefully this fixes the crash if the
	select() times out.

svn path=/trunk/; revision=12508
2001-08-29 02:25:59 +00:00
9e20b50bd1 Turn on --batch and reenable gpg keyserver lookups. (pgp_decrypt): Disable
2001-08-21  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Turn on --batch and reenable
	gpg keyserver lookups.
	(pgp_decrypt): Disable keyserver lookups if we are disconnected.

svn path=/trunk/; revision=12372
2001-08-21 22:45:41 +00:00
b37678ea31 Always do --no-auto-key-retrieve.
2001-08-06  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Always do --no-auto-key-retrieve.

svn path=/trunk/; revision=11703
2001-08-06 17:28:28 +00:00
c6daf26ade Minor changes to the iconv code so that it does the check in the return
2001-08-03  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Minor changes to the iconv
	code so that it does the check in the return value of iconv() just
	like the code in camel-mime-utils.c in case this fixes Bo Rosen's
	gpg bugs (but I doubt this will change anything?).

svn path=/trunk/; revision=11622
2001-08-03 20:36:24 +00:00
7d143c9c44 Sigh, if gpg returns '1' it means that the key is bad but it did succeede
2001-08-03  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_decrypt): Sigh, if gpg returns '1' it
	means that the key is bad but it did succeede in decrypting the
	block so to make users happy (even though I find this a
	questionable action) we are going to ignore the error and show it
	to the user anyway. This fixes bug #6136.

svn path=/trunk/; revision=11617
2001-08-03 18:02:12 +00:00
49e81a0bda Modified to treat the return value from camel_charset_locale_name() as a
2001-07-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Modified to treat the return
	value from camel_charset_locale_name() as a const char*.

	* camel-sasl-digest-md5.c (digest_response): Modified to treat the
	return value from camel_charset_locale_name() as a const char*.

	* camel-charset-map.c (camel_charset_locale_name): Modify to
	return const char* by returning the static locale_charset which is
	created inside of camel_charset_map_init().
	(camel_charset_map_init): Find the locale charset here and set the
	static variable.

svn path=/trunk/; revision=11245
2001-07-19 23:11:13 +00:00
ebd5da4c95 Forget the passphrase if the user has set that option. (pgp_clearsign):
2001-07-09  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_sign): Forget the passphrase if the
	user has set that option.
	(pgp_clearsign): Same.
	(pgp_encrypt): And here...
	(pgp_decrypt): And finally here.
	(camel_pgp_context_new): Take a `remember' argument.

svn path=/trunk/; revision=10932
2001-07-09 21:31:09 +00:00
15aeda78aa Set the pipe fd's to nonblocking.
2001-07-06  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (crypto_exec_with_passwd): Set the pipe fd's
	to nonblocking.

svn path=/trunk/; revision=10847
2001-07-06 16:52:44 +00:00
652c3e8225 Send the --no-auto-key-retrieve argument to gpg if we are in offline mode
2001-07-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Send the
	--no-auto-key-retrieve argument to gpg if we are in offline mode
	so that we don't have to worry about gpg hanging if it can't
	connect to the key servers, because now it shouldn't even attempt
	to.

svn path=/trunk/; revision=10831
2001-07-05 20:37:30 +00:00
ea4d1ae39e Send the --no-auto-key-retrieve argument to gpg so that we don't have to
2001-07-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Send the
	--no-auto-key-retrieve argument to gpg so that we don't have to
	worry about gpg hanging if it can't connect to the key servers,
	because now it shouldn't even attempt to.

svn path=/trunk/; revision=10827
2001-07-05 20:07:46 +00:00
2798919c3c Lots of fixes to get this to almost compile. Still struggling with the
2001-05-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-smime-context.c: Lots of fixes to get this to almost
	compile. Still struggling with the fact that CERTCertDBHandle is
	an "incomplete type". *sigh*.

	* camel-smime.c (camel_smime_part_verify): Updated to pass in a
	hash argument to camel_smime_verify().

	* camel-pgp-mime.c (camel_pgp_mime_part_verify): Update according
	to the changes in the context API.

	* camel-pgp-context.c (pgp_verify): Updated to take a
	CamelCipherHash argument.

	* camel-cipher-context.c (camel_cipher_verify): Now takes a hash
	argument since the S/MIME code needs this.

svn path=/trunk/; revision=9804
2001-05-14 22:25:02 +00:00
05817ac122 Replicate the semantics of the libunicode utf8 functions by returning NULL
2001-05-14  Jon Trowbridge  <trow@ximian.com>

        * camel-search-private.c (utf8_get): Replicate the semantics of
        the libunicode utf8 functions by returning NULL in the arg
        on invalid utf8.

        * camel-pgp-context.c (pgp_verify): Check for valid utf8,
        terminate loop if something looks wrong.

        * camel-mime-utils.c (header_encode_phrase_get_words): Properly
        check for invalid utf8.
        (header_encode_string): Properly check for invalid utf8.

        * camel-charset-map.c (camel_charset_step): Properly check for
        invalid utf8.

2001-05-14  Jon Trowbridge  <trow@ximian.com>

        * e-html-utils.c (is_citation): Check for bad utf8.

svn path=/trunk/; revision=9798
2001-05-14 21:04:35 +00:00
63e96e1002 Redo this a lot so that instead of having a class full of callbacks, we
* camel-session.c: Redo this a lot so that instead of having a
	class full of callbacks, we have a subclassable class. Also,
	replace the increasingly horrifying
	camel_session_query_authenticator with three new routines,
	camel_session_get_password, camel_session_forget_password, and
	camel_session_alert_user.

	* camel-pgp-context.c:
	* camel-pkcs7-context.c:
	* camel-smime-context.c:
	* providers/imap/camel-imap-store.c:
	* providers/pop3/camel-pop3-store.c:
	* providers/smtp/camel-smtp-transport.c:
	Use camel_session_get_password / camel_session_forget_password.

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Use
	camel_session_alert_user.

svn path=/trunk/; revision=9617
2001-04-27 21:08:08 +00:00
18af050c05 Remove UNICODE_CFLAGS (and some other stuff that's redundant with
* Makefile.am (INCLUDES): Remove UNICODE_CFLAGS (and some other
	stuff that's redundant with EXTRA_GNOME_CFLAGS)
	(libcamel_la_LIBADD): Replace UNICODE_LIBS with GAL_LIBS.

	* camel-search-private.c:
	* camel-pgp-context.c:
	* camel-mime-utils.c: Use gunicode interfaces rather than
	libunicode.

	* camel-charset-map.c: Use gunicode rather than libunicode. (The
	charmap-regen code still depends on libunicode though.)

	* camel-mime-filter-charset.h:
	* tests/message/test2.c (convert): Use iconv rather than
	unicode_iconv.

	* providers/smtp/Makefile.am (libcamelsmtp_la_LIBADD):
	* providers/pop3/Makefile.am (libcamelpop3_la_LIBADD):
	* providers/local/Makefile.am (libcamellocal_la_LIBADD): Remove
	UNICODE_LIBS.

	* camel.c (camel_init): Remove call to unicode_init.

	* camel-mime-parser.c: Remove unused unicode.h include.

svn path=/trunk/; revision=9585
2001-04-26 18:21:32 +00:00
c467d07a94 Oops, don't use the return value of iconv() as a string length, it only
2001-04-22  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Oops, don't use the return
	value of iconv() as a string length, it only tells us the number
	of non-reversable character conversions. This fixes it so we
	actually see the gpg output in the message viewer.

svn path=/trunk/; revision=9495
2001-04-23 00:20:19 +00:00
591856f980 don't use g_return's
svn path=/trunk/; revision=9396
2001-04-17 02:08:30 +00:00
f9b7406f1d Go back to doing the utf8 conversion by hand so that we don't depend on
2001-04-16  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (pgp_verify): Go back to doing the utf8
	conversion by hand so that we don't depend on gal.

svn path=/trunk/; revision=9387
2001-04-16 19:01:46 +00:00
500f1edcf4 eh?
svn path=/trunk/; revision=9377
2001-04-16 16:05:33 +00:00
dc90015fb8 Oops, lets not get into a recursive call here ;-)
2001-04-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (camel_pgp_context_get_type): Oops, lets not
	get into a recursive call here ;-)

	* tests/smime/pgp.c: Updated to reflect changes to the PGP code.

	* tests/smime/pgp-mime.c: Same.

svn path=/trunk/; revision=9287
2001-04-12 22:03:23 +00:00
0417c81c05 Updated to reflect the few changes made to the CamelPgpContext class.
2001-04-12  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-mime.c: Updated to reflect the few changes made to the
	CamelPgpContext class.

	* camel-pgp-context.c: Updated to subclass of CamelCipherContext.

	* camel-cipher-context.[c,h]: New base class for
	CamelPgpContext. Also contains the replacement for
	CamelPgpValidity, CamelCipherValidity.

svn path=/trunk/; revision=9283
2001-04-12 21:18:40 +00:00
1ca457947e Use e_utf8_from_locale_string() rather than trying to do it manually since
2001-04-11  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (camel_pgp_verify): Use
	e_utf8_from_locale_string() rather than trying to do it manually
	since Lauris's version works much better.

svn path=/trunk/; revision=9236
2001-04-11 14:02:14 +00:00
eee943f21e Added camel-pgp-context.[c,h] to the build. Also added tests/smime/pgp.c
2001-04-06  Jeffrey Stedfast  <fejj@ximian.com>

	* Makefile.am: Added camel-pgp-context.[c,h] to the build. Also
	added tests/smime/pgp.c and Makefile.am

	* tests/smime/pgp.c: New test suite for PGP functions.

	* camel-pgp-context.c: Various fixes to get it to build.

svn path=/trunk/; revision=9213
2001-04-10 15:47:00 +00:00
9a38f85121 mutex lock & unlock the context. (camel_pgp_clearsign): Same.
2001-04-02  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.c (camel_pgp_sign): mutex lock & unlock the context.
	(camel_pgp_clearsign): Same.
	(camel_pgp_verify): Same.
	(camel_pgp_encrypt): Same.
	(camel_pgp_decrypt): And finally here...

svn path=/trunk/; revision=9096
2001-04-02 07:24:37 +00:00
9f642307d2 Update the function prototypes to match those found in
2001-04-02  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.h: Update the function prototypes to match
	those found in camel-pgp-context.c.

	* camel-pgp-context.c: Updated.

	* camel-pgp-mime.c (camel_pgp_mime_part_sign): Implemented.
	(camel_pgp_mime_part_verify): Implemented.
	(camel_pgp_mime_part_encrypt): Implemented.
	(camel_pgp_mime_part_decrypt): Implemented.

svn path=/trunk/; revision=9095
2001-04-02 07:10:28 +00:00
bf26d96809 New class for PGP encrypting, decrypting, signing and verifying. Next I'll
2001-03-28  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-pgp-context.[c,h]: New class for PGP encrypting,
	decrypting, signing and verifying. Next I'll be moving the
	contents of mail/mail-crypto into Camel. These files will
	basically replace mail/openpgp-utils.[c,h].

svn path=/trunk/; revision=9008
2001-03-29 04:53:26 +00:00