Commit Graph

60 Commits

Author SHA1 Message Date
dbf631a87d Various fixes to make it work.
2003-08-18  Not Zed  <NotZed@Ximian.com>

        * camel-http-stream.c: Various fixes to make it work.

        * tests/smime/pgp-mime.c (main): added missing 'ret' variable.

        * providers/smtp/camel-smtp-transport.c (connect_to_server):
        * providers/imapp/camel-imapp-store.c (connect_to_server:
        * providers/imap/camel-imap-store.c (connect_to_server):
        * providers/pop3/camel-pop3-store.c (connect_to_server):
        * camel-http-stream.c (http_connect): change service->session for
        tcp_stream_ssl_new.

        * camel-tcp-stream-ssl.c: Changed service to session, and fix some
        refcounting of it.
        include camel-operation.h

svn path=/trunk/; revision=22275
2003-08-19 02:36:31 +00:00
911fdb7885 continue reading the cert file until we've read it all or get a non-EINTR
2003-03-21  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (camel_certdb_nss_cert_get): continue
	reading the cert file until we've read it all or get a non-EINTR
	errno.

svn path=/trunk/; revision=20457
2003-03-21 18:54:52 +00:00
32a764399b Same as IMAP and POP.
2003-02-28  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/smtp/camel-smtp-transport.c (connect_to_server): Same
	as IMAP and POP.

	* providers/imap/camel-imap-store.c (connect_to_server): Same as
	the POP3 code.

	* providers/pop3/camel-pop3-store.c (connect_to_server): Pass in
	appropriate flags for camel_tcp_stream_ssl_new*() functions.

	* camel-tcp-stream-ssl.c (enable_ssl): Not all ssl/tls streams
	will want to allow each of SSLv2, SSLv3 and TLSv1 so use flags to
	decide which to enable/disable.
	(camel_tcp_stream_ssl_new): Now takes a flags argument to mask out
	which SSL/TLS versions the stream should be compatable with.
	(camel_tcp_stream_ssl_new_raw): Same.

svn path=/trunk/; revision=20111
2003-02-28 21:55:06 +00:00
a52f657ed8 Fixed a type-o in the ENABLE_IPv6 ifdef section.
2003-02-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (stream_connect): Fixed a type-o in the
	ENABLE_IPv6 ifdef section.

svn path=/trunk/; revision=19954
2003-02-19 23:44:00 +00:00
eaa2814a05 Use the new camel_operation_cancel_prfd() function to get the cancellation
2002-11-21  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (stream_read): Use the new
	camel_operation_cancel_prfd() function to get the cancellation fd
	so we can poll on it for cancellation stuff.
	(stream_write): Same.

2002-11-22  Not Zed  <NotZed@Ximian.com>

	* camel-operation.c (camel_operation_cancel_prfd): Implement, gets
	a nspr pr filedesc to poll/wait on
	(struct _CamelOperation): include a pr filedesc.

svn path=/trunk/; revision=18894
2002-11-22 22:29:56 +00:00
3eabd14ace Use g_strerror when setting an exception string (we need it to be in
2002-11-11  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/local/camel-spool-summary.c (spool_summary_sync_full):
	Use g_strerror when setting an exception string (we need it to be
	in UTF-8).
	(spool_summary_check): Here too.

	* providers/local/camel-spool-store.c (construct): Use g_strerror
	when setting an exception string (we need it to be in UTF-8).
	(get_folder): Same.
	(scan_dir): Here too.

	* providers/local/camel-spool-folder.c (spool_lock): Use
	g_strerror when setting an exception string (we need it to be in
	UTF-8).

	* providers/local/camel-mh-summary.c (mh_summary_check): Use
	g_strerror when setting an exception string (we need it to be in
	UTF-8).

	* providers/local/camel-mh-store.c (delete_folder): Use g_strerror
	when setting an exception string (we need it to be in UTF-8).

	* providers/local/camel-mbox-summary.c (summary_update): Use
	g_strerror when setting an exception string (we need it to be in
	UTF-8).
	(mbox_summary_sync_full): Here too.
	(mbox_summary_sync_quick): Same.
	(mbox_summary_sync): Also here.
	(camel_mbox_summary_sync_mbox): Again here.

	* providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror
	when setting an exception string (we need it to be in UTF-8).
	(mbox_append_message): Same.
	(mbox_get_message): Here too.

	* providers/local/camel-maildir-summary.c (maildir_summary_load):
	Use g_strerror when setting an exception string (we need it to be
	in UTF-8).
	(maildir_summary_check): Same.

	* providers/local/camel-maildir-store.c (get_folder): Use
	g_strerror when setting an exception string (we need it to be in
	UTF-8).
	(delete_folder): Same.
	(delete_folder): Here too.

	* providers/local/camel-local-summary.c (local_summary_sync): Use
	g_strerror when setting an exception string (we need it to be in
	UTF-8).

	* providers/local/camel-local-store.c (get_folder): Use g_strerror
	when setting an exception string (we need it to be in UTF-8).
	(create_folder): Same.
	(xrename): Here too.
	(rename_folder): And here.
	(delete_folder): Also here.

	* camel-provider.c (camel_provider_init): For debugging printfs,
	we want to use normal strerror (we want locale charset, not
	UTF-8).

	* camel-movemail.c (camel_movemail): Use g_strerror when setting
	an exception string (we need it to be in UTF-8).
	(movemail_external): Same.
	(camel_movemail_copy_file): Here too.
	(camel_movemail_solaris): Also here.

	* camel-mime-utils.c (rfc2047_decode_word): For debugging printfs,
	we want to use normal strerror (we want locale charset, not
	UTF-8).
	(header_encode_param): Same.

	* camel-mime-part-utils.c (convert_buffer): For debugging printfs,
	we want to use normal strerror (we want locale charset, not
	UTF-8).

	* camel-lock-client.c (camel_lock_helper_init): Use g_strerror
	when setting an exception string (we need it to be in UTF-8).

	* camel-data-cache.c (camel_data_cache_remove): Use g_strerror
	when setting an exception string (we need it to be in UTF-8).

	* camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs,
	we want to use normal strerror (we want locale charset, not
	UTF-8).
	(flaky_tcp_read): Same.

	* camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we
	want to use normal strerror (we want locale charset, not UTF-8).

	* camel-service.c (camel_gethostbyname): Use g_strerror when
	setting an exception string (we need it to be in UTF-8).

	* camel-lock.c (camel_lock_dot): Use g_strerror when setting an
	exception string (we need it to be in UTF-8).
	(camel_lock_fcntl): Same.

svn path=/trunk/; revision=18689
2002-11-11 06:24:56 +00:00
a28bbcd16f #include "camel-stream-fs.h" for writing out the certs to disk
svn path=/trunk/; revision=18395
2002-10-18 17:59:59 +00:00
50e16acfc8 If ~/.camel_certs doesn't exist, create it.
2002-10-17  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (camel_certdb_nss_cert_set): If
	~/.camel_certs doesn't exist, create it.

svn path=/trunk/; revision=18391
2002-10-18 03:03:13 +00:00
d4e1fb42e0 helper, build fingerprint. (camel_certdb_nss_cert_get): Helper for nss
2002-10-15  Not Zed  <NotZed@Ximian.com>

        * camel-tcp-stream-ssl.c (cert_fingerprint): helper, build
        fingerprint.
        (camel_certdb_nss_cert_get): Helper for nss certs.  Lookup cert.
        As well as fingerprint, the whole raw cert is checked for
        validity.
        (camel_certdb_nss_cert_add): Add an nss cert to a certdb, also
        saves the cert by fingerprint in ~/.camel_certs/.
        (ssl_bad_cert): Changed to use above functions to simplify logic.
        (ssl_bad_cert): Also added non-compiled code which mimics what
        mozilla does, but it doesn't work right :-/
        (camel_certdb_nss_cert_set): Save the raw cert associated with a
        cert.

        * camel-certdb.c (certdb_cert_free): Free the raw cert data if
        set.

2002-10-14  Not Zed  <NotZed@Ximian.com>

        * camel-file-utils.c (camel_file_util_encode_string): Encode a
        length of 0 as 1, not 0, to match the decode code.

svn path=/trunk/; revision=18385
2002-10-17 03:56:13 +00:00
7ed66fac42 New function to decode the INTERNALDATE response from an IMAP server so we
2002-09-27  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/imap/camel-imap-folder.c (decode_internaldate): New
	function to decode the INTERNALDATE response from an IMAP server
	so we don't have to use my broken-date-parser routines.

2002-09-27  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/imap/camel-imap-store.c (connect_to_server):
	NULL-check the streams before unreffing them in the case of a
	failure during ssl negotiations.

	* camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_enable_ssl): Check
	SSL_ResetHandshake() for errors. Also force a handshake after
	we've reset the handshake state on the socket.

svn path=/trunk/; revision=18252
2002-09-27 20:20:08 +00:00
8137a35173 Update the comment.
2002-07-30  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream.c (camel_tcp_address_new): Update the comment.

	* camel-tcp-stream-raw.c (socket_connect): If building with IPv6
	support and the address is an IPv6 address, connect using a
	sockaddr_in6 otherwise use the standard IPv4 sockaddr_in
	structure.
	(stream_get_local_address): Fix to work with IPv6 addresses.
	(stream_get_remote_address): Same.

	* camel-tcp-stream-openssl.c (socket_connect): Same as above.
	(stream_get_local_address): Fix to work with IPv6 addresses.
	(stream_get_remote_address): Same.

	* camel-tcp-stream-ssl.c (stream_connect): If building with IPv6
	support and the address is an IPv6 address, initialise the
	PRNetAddr accordingly.
	(stream_get_local_address): Fix to work with IPv6 addresses.
	(stream_get_remote_address): Same.

svn path=/trunk/; revision=17651
2002-07-31 01:03:10 +00:00
b0633536f2 New source file implementing a very basic certificate database. This is
2002-07-30  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-certdb.c: New source file implementing a very basic
	certificate database. This is mostly just here because the Mozilla
	NSS certdb seems to not be working for everyone's Evolution
	install (works fine for me and Ettore but not many other people).

	* camel-tcp-stream-ssl.c (ssl_bad_cert): If we have this
	certificate in our own CamelCertDB, then get the trust value from
	that and only prompt the user if the trust is unknown.

	* camel-tcp-stream-openssl.c (ssl_verify): Same.

	* camel.c (camel_init): Create our default certdb.

svn path=/trunk/; revision=17642
2002-07-30 19:16:11 +00:00
d67d5483f4 PR_IO_TIMEOUT_ERROR should map to ETIMEDOUT and not EAGAIN.
2002-06-20  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (set_errno): PR_IO_TIMEOUT_ERROR should
	map to ETIMEDOUT and not EAGAIN.
	(stream_connect): Reset the PR_Poll() timeout back to 2 minutes as
	this wasn't the problem afterall.

svn path=/trunk/; revision=17246
2002-06-20 06:34:14 +00:00
31cc3a1eb4 Set the poll timeout to be PR_INTERVAL_MIN, this one shouldn't need to be
2002-06-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (stream_connect): Set the poll timeout to
	be PR_INTERVAL_MIN, this one shouldn't need to be 2 minutes (plus
	it blocks my connection at home for far too long).

svn path=/trunk/; revision=17234
2002-06-19 18:13:24 +00:00
1957762cbf Fixed compiler warnings.
2002-06-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-arg.c:
	* camel-disco-diary.c:
	* camel-index-control.c:
	* camel-mime-part.c:
	* camel-pgp-mime.c:
	* camel-store.c:
	* camel-tcp-stream-ssl.c:
	* camel-text-index.c: Fixed compiler warnings.

svn path=/trunk/; revision=17187
2002-06-14 21:33:45 +00:00
88bf7aaa37 Up the timeout on the connect code to 2 minutes.
2002-06-07  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (stream_connect): Up the timeout on the
	connect code to 2 minutes.

svn path=/trunk/; revision=17140
2002-06-07 05:53:08 +00:00
35cd31644f Make the folder_lock recursive. See bug #22363 for details. Basically,
2002-04-09  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-store.c (camel_store_init): Make the folder_lock
	recursive. See bug #22363 for details. Basically,
	get_folder_info() is requesting a diary folder which in turn
	connects which requests then calls get_folder() but deadlocks
	because get_folder_info already holds the lock.

svn path=/trunk/; revision=16419
2002-04-10 03:02:33 +00:00
be23d106da Handle a ton more nspr i/o errno's. (stream_connect): Act as if we are
2002-04-02  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (set_errno): Handle a ton more nspr i/o
	errno's.
	(stream_connect): Act as if we are doing a non-blocking
	connect. This is to try and work around bug #15120 where users get
	an EINPROGRESS error. Maybe importing a PRFileDesc into SSL mode
	automagically makes it non-blocking? I dunno.

2002-04-01  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-summary.c (message_info_new): Updated the
	construction of the references to match JWZ's updated algorithm
	initialization (ie, append any In-Reply-To reference onto any
	References header and never take more than a single message-id
	from the In-Reply-To header since anything after the first will
	probably just be email addresses). Fixes bug #1336.

svn path=/trunk/; revision=16327
2002-04-02 23:04:11 +00:00
6024691d3c Rename the OpenSSL implementation of things to match the NSS
implementation so that callers	don't need to care which one is
	being used.

	* camel-tcp-stream-openssl.c: Implement CamelTcpStreamSSL, not
	CamelTcpStreamOpenSSL. Rename methods as well. Replace the
	camel-tcp-stream-openssl.h include with camel-tcp-stream-ssl.h.

        * camel-tcp-stream-openssl.h: Gone.

        * camel-tcp-stream-ssl.c: Add a note explaining that this
	implementation is only used for NSS, and that OpenSSL's
	implementation is in another file. (Should probably do some CVS
	renaming magic at some point.)

        * camel-http-stream.c (http_connect): Remove OpenSSL refs; the
        previously-NSS-specific code works for both now.

        * camel-remote-store.c: Likewise.

        * providers/smtp/camel-smtp-transport.c: Likewise.

        * providers/pop3/camel-pop3-store.c: Likewise.

        * Makefile.am (libcamelinclude_HEADERS): Remove
	camel-tcp-stream-openssl.h

svn path=/trunk/; revision=16093
2002-03-11 02:33:27 +00:00
b1b809031f Remove this: it couldn't be generically used, because different subclasses
* camel-tcp-stream.c (camel_tcp_stream_get_socket): Remove this:
	it couldn't be generically used, because different subclasses
	returned entirely different types of data.
	(camel_tcp_stream_get_local_address,
	camel_tcp_stream_get_remote_address): Add these to replace what
	get_socket was being used for.
	(camel_tcp_address_new, camel_tcp_address_free): Utility functions
	for get_{local,remote}_address.

	* providers/smtp/camel-smtp-transport.c: Change localaddr to a
        CamelTcpAddress *.
        (connect_to_server): Call camel_tcp_stream_get_local_address to
	get the local IP address.
        (smtp_disconnect): free	localaddr.
        (smtp_helo): Update for localaddr change.

        * camel-tcp-stream-raw.c (stream_get_socket): Remove
	(stream_get_local_address, stream_get_remote_address): Implement.

	* camel-tcp-stream-ssl.c (stream_get_socket): Remove
	(stream_get_local_address, stream_get_remote_address): Implement.

        * camel-tcp-stream-openssl.c (stream_get_socket): Remove
	(stream_get_local_address, stream_get_remote_address): Implement.

svn path=/trunk/; revision=16092
2002-03-11 00:53:49 +00:00
3110d8b740 Removed. Glory glory hallelujah! (ssl_bad_cert): No longer calls
2002-03-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (save_ssl_cert): Removed. Glory glory
	hallelujah!
	(ssl_bad_cert): No longer calls ssl_save_cert or
	ssl_cert_is_saved.

svn path=/trunk/; revision=15938
2002-03-06 00:54:22 +00:00
bdb8a0a993 Start the ssl stream off in non-ssl mode (useful for STARTTLS).
2002-03-05  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-openssl.c (camel_tcp_stream_openssl_new_raw):
	Start the ssl stream off in non-ssl mode (useful for STARTTLS).
	(camel_tcp_stream_openssl_enable_ssl): New function to toggle an
	ssl stream into ssl mode.
	(open_ssl_connection): Close the sockfd on fail so our caller
	doesn't have to - this also allows us to save the original errno.
	(stream_connect): If we want ssl mode, do our ssl stuff.
	(camel_tcp_stream_openssl_class_init): Init some SSL stuff here
	instead of in open_ssl_connection since these only ever need to be
	called once.
	(stream_read): Only use SSL_read if we are in ssl mode.
	(stream_write): Only use SSL_write if we are in ssl mode.

	* providers/smtp/camel-smtp-transport.c (smtp_helo): Check for the
	STARTTLS extension.
	(connect_to_server): Try to use STARTTLS whenever possible rather
	than the old way of doing things.
	(connect_to_server_wrapper): Wrapper around connect_to_server() to
	first try STARTTLS and then attempt normal SSL mode if we can't
	connect via STARTTLS.

	* camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_enable_ssl): New
	function to toggle an ssl stream into ssl mode.
	(camel_tcp_stream_ssl_new_raw): Start the ssl stream off in
	non-ssl mode (useful for STARTTLS).
	(stream_connect): Only connect in SSL mode if required.

svn path=/trunk/; revision=15937
2002-03-06 00:33:37 +00:00
ec14bae134 Call set_errno appropriately.
2002-02-04  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (stream_connect): Call set_errno
	appropriately.

svn path=/trunk/; revision=15566
2002-02-04 19:58:02 +00:00
482507aff7 so my guess is that mutt probably doesn't compile since we don't compile using the functions that mutt uses.
this is why I love libnss.

svn path=/trunk/; revision=15229
2002-01-02 21:32:31 +00:00
57a95b0977 Do more like what mutt does so hopefully this'll fix bug #16363 and
2002-01-02  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Do more like what mutt
	does so hopefully this'll fix bug #16363 and #16300.

svn path=/trunk/; revision=15226
2002-01-02 19:16:45 +00:00
9b0ffde9c0 Added a check to see if the operation has been cancelled. (stream_write):
2001-11-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (stream_read): Added a check to see if
	the operation has been cancelled.
	(stream_write): Same.

svn path=/trunk/; revision=14751
2001-11-19 21:00:25 +00:00
4e96a9415b Oops, pass a mode argument to the open() call.
2001-11-07  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (save_ssl_cert): Oops, pass a mode
	argument to the open() call.

	* camel-tcp-stream-openssl.c (save_ssl_cert): Oops, pass a mode
	argument to the open() call.

svn path=/trunk/; revision=14636
2001-11-09 00:38:51 +00:00
2a5e8cb179 Removed. (stream_write): Keep looping (non-blocking case) if errno is
2001-10-29  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-openssl.c (my_SSL_write): Removed.
	(stream_write): Keep looping (non-blocking case) if errno is
	EAGAIN, EINTR or EWOULDBLOCK. For NONBLOCKing I/O, sync up with
	CamelTcpStreamRaw. As with CamelTcpStreamRaw/SSL - make sure to
	write out everything before returning.
	(my_SSL_read): Removed.
	(stream_read): Just call ssl_error_to_errno() and check the errno
	values that we care about so we can keep the general look of all
	this stream code the same. Also when checking the return value of
	SSL_read, check for <0 instead of ==-1 since the man page for
	SSL_read doesn't say it will return -1 on fail, it just says <0.
	(stream_flush): Don't fsync() since syncing on a socket is a Bad
	Thing (tm).

	* camel-tcp-stream-ssl.c (stream_write): Make sure we write out
	everything just like in camel-tcp-stream-raw.c.

	* camel-stream-buffer.c (camel_stream_buffer_gets): If
	camel_stream_read() returns -1, don't necessarily return -1 to our
	caller since it's possible that we did actually "read" some data
	(ie, we copied some pre-buffered data into the out buffer).

	* camel-stream-buffer.h: Removed CAMEL_STREAM_BUFFER_NEWLINE since
	it never got used anywhere and it isn't supported anyway.

svn path=/trunk/; revision=14409
2001-10-30 03:09:01 +00:00
42606efd98 More fixing of the license texts.
svn path=/trunk/; revision=14216
2001-10-27 18:06:04 +00:00
d965c00a22 Same.
2001-10-11  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_cert_is_saved): Same.

	* camel-tcp-stream-openssl.c (ssl_cert_is_saved): Instead of
	opening the file, stat it and make sure that it belongs to us.

svn path=/trunk/; revision=13600
2001-10-11 21:57:20 +00:00
f3e2d67d4d Same hack as below.
2001-10-10  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-openssl.c (ssl_verify): Same hack as below.

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Hack around the fact that
	adding a cert to nss's certdb seems to not work.

svn path=/trunk/; revision=13575
2001-10-10 22:13:05 +00:00
7b834caab7 remove unused variable
svn path=/trunk/; revision=13364
2001-10-03 02:56:40 +00:00
27da08a1bf Import the certificate if the user accepts it.
2001-10-02  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Import the certificate if
	the user accepts it.

svn path=/trunk/; revision=13363
2001-10-03 02:55:50 +00:00
f9329be8ee Oops, don't fail if `data' isn't a CamelService...cuz it's not supposed to
2001-09-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Oops, don't fail if
	`data' isn't a CamelService...cuz it's not supposed to be! It's a
	CamelTcpStreamSSL object...doh!

svn path=/trunk/; revision=12992
2001-09-19 22:09:36 +00:00
1751d70335 #if 0 out the code that was hopefully going to fix bug #5325 because the
2001-09-07  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): #if 0 out the code that
	was hopefully going to fix bug #5325 because the functions I used
	seem to have been deprecated. *sigh*.

svn path=/trunk/; revision=12699
2001-09-08 00:42:09 +00:00
d53fdf3ae9 #include pk11func.h. (ssl_bad_cert): Use CERT_GetDefaultCertDB.
2001-08-30  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c: #include pk11func.h.
	(ssl_bad_cert): Use CERT_GetDefaultCertDB.

svn path=/trunk/; revision=12530
2001-08-30 17:20:39 +00:00
fb7ab0fcbe If the user accepts the certificate, add it to the database as a trusted
2001-08-28  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): If the user accepts the
	certificate, add it to the database as a trusted CA.

svn path=/trunk/; revision=12502
2001-08-28 20:41:01 +00:00
7a8894af60 er, OptionSet
svn path=/trunk/; revision=9785
2001-05-13 01:44:16 +00:00
40e30e58b8 s/SSL_Enable/SSL_SetOption
svn path=/trunk/; revision=9784
2001-05-13 01:42:48 +00:00
b3424b533c call SSL_Enable after the SSL_ImportFD and before PR_Connect. Otherwise,
2001-05-10  Chris Toshok  <toshok@ximian.com>

	* camel-tcp-stream-ssl.c (stream_connect): call SSL_Enable after
	the SSL_ImportFD and before PR_Connect.  Otherwise, NSS aborts
	during the connect.

svn path=/trunk/; revision=9751
2001-05-10 22:03:08 +00:00
d3bcd3e9d6 Remove the last argument from camel_session_alert_user.
2001-05-01  Anders Carlsson  <andersca@codefactory.se>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Remove the last argument from
	camel_session_alert_user.

svn path=/trunk/; revision=9640
2001-05-01 19:44:45 +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
fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
0ec6ccc4df Return -1 on fail. (camel_filter_driver_filter_folder): Same.
2001-03-21  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-filter-driver.c (camel_filter_driver_filter_message):
	Return -1 on fail.
	(camel_filter_driver_filter_folder): Same.
	(camel_filter_driver_filter_mbox): Same.
	(camel_filter_driver_filter_folder): Return -1 if an exception was
	set as well.

2001-03-19  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-openssl.c (camel_tcp_stream_openssl_finalize):
	Free the expected host.
	(camel_tcp_stream_openssl_new): Now takes a Service and an
	expected_host. Set them.

svn path=/trunk/; revision=8871
2001-03-21 21:45:26 +00:00
c768305c2f Don't include system include dir.
2001-03-17  Jeffrey Stedfast <fejj@ximian.com>

	* Makefile.am: Don't include system include dir.

	* camel.c: Use quotes around the nss.h include so it doesn't try
	to use the systen nss.h file.

	* camel-tcp-stream-ssl.c: Same here.

svn path=/trunk/; revision=8786
2001-03-17 22:13:19 +00:00
a9df5de4af Print info about the issuer of the certificate.
2001-03-16  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (ssl_bad_cert): Print info about the
	issuer of the certificate.

	* providers/smtp/camel-smtp-transport.c (smtp_connect): Use
	camel_tcp_stream_get_socket().

	* camel-tcp-stream-openssl.c (stream_get_socket): Implemented.

	* camel-tcp-stream-ssl.c (stream_get_socket): Implemented.

	* camel-tcp-stream-raw.c (stream_get_socket): Implemented.

	* camel-tcp-stream.c (camel_tcp_stream_get_socket): New function.

svn path=/trunk/; revision=8764
2001-03-16 23:02:04 +00:00
403205b15e Don't use the hardcoded cert db directory, use the one passed in.
2001-03-15  Jeffrey Stedfast  <fejj@ximian.com>

	* camel.c (camel_init): Don't use the hardcoded cert db directory,
	use the one passed in.

	* camel-tcp-stream-ssl.c (ssl_get_client_auth): Wrote the default
	implementation. Not that we'll use this though, since this is the
	default implementation provided by NSS anyway. This more or less
	serves as a reference in case we want to change anything.
	(ssl_auth_cert): Same.
	(ssl_bad_cert): Changed the prompt string and free it when we're
	done.

svn path=/trunk/; revision=8753
2001-03-16 04:41:49 +00:00
369d9ddc67 Ya know what? Lets not ref the service because otherwise we'll start
2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_new): Ya know what?
	Lets not ref the service because otherwise we'll start having the
	same problems we had back with vtrash. Besides, since the store
	owns the stream, it's not like the store is going anywhere without
	the stream anyway.
	(camel_tcp_stream_ssl_finalize): No need to unref the service.

svn path=/trunk/; revision=8722
2001-03-15 02:56:06 +00:00
c0686e978d Pass the service into the SSL stream, not the session.
2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-remote-store.c (remote_connect): Pass the service into the
	SSL stream, not the session.

	* camel-tcp-stream-ssl.c (camel_tcp_stream_ssl_init): Set the
	service to NULL.
	(camel_tcp_stream_ssl_finalize): Unref the service.
	(camel_tcp_stream_ssl_new): Takes a CamelService arg now rather
	than a CamelSession arg.

svn path=/trunk/; revision=8720
2001-03-15 02:33:34 +00:00
343844c138 Eek! So the service's URL isn't set until after this is initialized. This
2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>

	* providers/imap/camel-imap-store.c (camel_imap_store_init): Eek!
	So the service's URL isn't set until after this is
	initialized. This means we can't check for SSL here.
	(imap_connect): Set the SSL options here instead.

svn path=/trunk/; revision=8715
2001-03-15 00:51:09 +00:00