aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-gpg-context.c
Commit message (Collapse)AuthorAgeFilesLines
* Added some debug stuff.Not Zed2004-07-191-3/+60
| | | | | | | | 2004-07-16 Not Zed <NotZed@Ximian.com> * camel-gpg-context.c: Added some debug stuff. svn path=/trunk/; revision=26672
* ** This is no guarantee of security, but its just a helper to prevent oldNot Zed2004-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-07-09 Not Zed <NotZed@Ximian.com> ** This is no guarantee of security, but its just a helper to prevent old memory accidentally being included/used elsewhere. * camel-smime-context.c (sm_decrypt): mark the output stream 'secure'. * camel-gpg-context.c (gpg_decrypt): set the output stream to secured, so we automagically blank it out on finalise. * camel-stream-mem.c (camel_stream_mem_set_secure): set the memory-stream 'secured', all we do at the moment is blank out the buffer on finalise. (camel_stream_mem_set_byte_array, camel_stream_mem_finalize): clear memory if owner and secured. kill dead comment. (clear_mem): utilitiy to set memory to 0xABADF00D 2004-07-08 Not Zed <NotZed@Ximian.com> ** See bug #61186. * camel-cipher-context.c (camel_cipher_sign): (camel_cipher_verify, camel_cipher_encrypt, camel_cipher_decrypt): Add preliminary progress reporting. svn path=/trunk/; revision=26629
* Use camel_multipart_signed_get_content_stream() rather than getting theJeffrey Stedfast2004-06-151-11/+12
| | | | | | | | | | 2004-06-15 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Use camel_multipart_signed_get_content_stream() rather than getting the first part and canonicalising it ourselves. Fixes bug #60159. svn path=/trunk/; revision=26350
* Fixed a case where it was possible to double-free the gpg context.Jeffrey Stedfast2004-06-091-6/+4
| | | | | | | | | | | 2004-06-09 Jeffrey Stedfast <fejj@novell.com> * camel-gpg-context.c (gpg_verify): Fixed a case where it was possible to double-free the gpg context. (gpg_verify): If we don't have a public key, then the signature is just BAD always. svn path=/trunk/; revision=26271
* oops, we already did a NODATA check. just save the state there rather than ↵Jeffrey Stedfast2004-06-091-2/+1
| | | | | | creating a new NODATA check :-) svn path=/trunk/; revision=26267
* oops, decrement the gpg->padding widthJeffrey Stedfast2004-06-091-2/+2
| | | | svn path=/trunk/; revision=26266
* Don't assign trust to be UNKNOWN if gpg sent us a NODATA status.Jeffrey Stedfast2004-06-091-1/+5
| | | | | | | | | 2004-06-09 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Don't assign trust to be UNKNOWN if gpg sent us a NODATA status. svn path=/trunk/; revision=26265
* added a 'domain' argument, and rearragned arguments to be prettier andNot Zed2004-05-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-05-21 Not Zed <NotZed@Ximian.com> * camel-session.c (camel_session_get_password): added a 'domain' argument, and rearragned arguments to be prettier and more consistent. Fixed all callers. (camel_session_forget_password): added a domain argument. Fixed all callers. ** See #58376. * camel-folder.c (set_message_flags): if system flags change, then don't trigger a folder changed event. * camel-folder-summary.h (CAMEL_MESSAGE_SYSTEM_MASK): added this to indicate which flags are internal/apps not interested in. * camel-folder.c (filter_free): rearrange and use some helpers. (folder_changed): if we're frozen, dont go firing off threads to do any processing on each change, wait until we're called unfrozen. Slight code rearragnement. (filter_filter): add progress to junk learn/unlearn, and separate them. svn path=/trunk/; revision=26029
* If the encrypted block was also signed, set the signature verificationJeffrey Stedfast2004-05-181-8/+37
| | | | | | | | | | 2004-05-17 Jeffrey Stedfast <fejj@novell.com> * camel-gpg-context.c (gpg_decrypt): If the encrypted block was also signed, set the signature verification status on the Validity structure as well. svn path=/trunk/; revision=25928
* Fix for bug #56878.Jeffrey Stedfast2004-04-131-8/+17
| | | | | | | | | | | | | | | | 2004-04-12 Jeffrey Stedfast <fejj@ximian.com> Fix for bug #56878. * camel-gpg-context.c (gpg_verify): Don't rely on the exit code of gpg, we already save enough state to decide if the sig is valid without it. Modified to only set BAD if gpg->validsig and gpg->nopubkey are both FALSE. If we get a NO_PUBKEY status message, then it simply means that the the sender could not be verified. (gpg_ctx_parse_status): Listen for NO_PUBKEY status messages. svn path=/trunk/; revision=25420
* get the content-type off of the multipart-signed, not its container. ThisNot Zed2004-03-291-2/+2
| | | | | | | | | | 2004-03-29 Not Zed <NotZed@Ximian.com> * camel-gpg-context.c (gpg_verify): get the content-type off of the multipart-signed, not its container. This seems wrong ... but might fix #56084. svn path=/trunk/; revision=25218
* ignore NODATA response, otherwise we abort in a meaningless way. SeeNot Zed2004-02-271-10/+2
| | | | | | | | | 2004-02-27 Not Zed <NotZed@Ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): ignore NODATA response, otherwise we abort in a meaningless way. See #52939. svn path=/trunk/; revision=24904
* Use the trust to decide the validity signature status. (Better way ofJeffrey Stedfast2004-02-191-2/+7
| | | | | | | | | | | | 2004-02-18 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Use the trust to decide the validity signature status. (Better way of solving yesterday's problem) * camel-cipher-context.h: Revert change from yesterday. svn path=/trunk/; revision=24779
* Set the trust.Jeffrey Stedfast2004-02-181-2/+6
| | | | | | | | | | 2004-02-17 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): Set the trust. * camel-cipher-context.h: Add a trust metric to signatures. svn path=/trunk/; revision=24763
* Forget the need_id, not the userid. Fixes bug #53908.Jeffrey Stedfast2004-02-071-1/+1
| | | | | | | | | 2004-02-06 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): Forget the need_id, not the userid. Fixes bug #53908. svn path=/trunk/; revision=24658
* ** See bug #52817.Not Zed2004-01-201-1/+1
| | | | | | | | | | | | 2004-01-20 Not Zed <NotZed@Ximian.com> ** See bug #52817. * camel-session.c (camel_session_get_password): merged reprompt and secret into a flags field, and add more options. Fixed all callers. svn path=/trunk/; revision=24323
* ** See bug #52899.Not Zed2004-01-201-1/+1
| | | | | | | | | | | 2004-01-20 Not Zed <NotZed@Ximian.com> ** See bug #52899. * camel-gpg-context.c (gpg_ctx_parse_status): use need_id as the password key, not userid. svn path=/trunk/; revision=24315
* Don't immediately prompt for a passwd after receiving the NEED_PASSPHRASEJeffrey Stedfast2003-12-121-13/+23
| | | | | | | | | | | | | | | 2003-12-11 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): Don't immediately prompt for a passwd after receiving the NEED_PASSPHRASE status message. Instead, parse the userid that gpg needs a passwd for and store it on our context. Wait for a GET_HIDDEN status message before prompting, this way if the user has their gpg configured to use gpg-agent, the user won't get 2 passwd prompts. (gpg_sign): Fixed to not free a gpg context that we have not allocated (could happen in a fail case). svn path=/trunk/; revision=23925
* Properly set the O_NONBLOCK flag along with any previously set flags.Jeffrey Stedfast2003-12-061-5/+14
| | | | | | | | | | | | | | | | 2003-12-05 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_op_start): Properly set the O_NONBLOCK flag along with any previously set flags. * camel-filter-search.c (run_command): Don't set O_NONBLOCK on the pipe (1. we don't need to, and 2. we should have been setting O_NONBLOCK|prev_flags but we weren't, and so the pipe got O_RDONLY|O_NONBLOCK even tho we wanted to write to it). * camel-filter-driver.c (pipe_to_system): Same. svn path=/trunk/; revision=23651
* ** See bug #51478.Not Zed2003-12-021-1/+4
| | | | | | | | | | | 2003-12-02 Not Zed <NotZed@Ximian.com> ** See bug #51478. * camel-gpg-context.c (gpg_ctx_free): handle the context being NULL, and exit silently. svn path=/trunk/; revision=23550
* Start at fd = 3.Jeffrey Stedfast2003-12-021-10/+5
| | | | | | | | | | | | | | 2003-12-01 Jeffrey Stedfast <fejj@ximian.com> * camel-process.c (camel_process_fork): Start at fd = 3. * camel-gpg-context.c (gpg_ctx_op_start): Same. * camel-filter-driver.c (pipe_to_system): Same. * camel-filter-search.c (run_command): Start at fd = 3. svn path=/trunk/; revision=23549
* Same.Jeffrey Stedfast2003-12-011-1/+1
| | | | | | | | | | | | | | | | | | | 2003-12-01 Jeffrey Stedfast <fejj@ximian.com> * camel-stream-process.c (do_exec_command): Same. * camel-process.c (camel_process_fork): Same. * camel-filter-search.c (run_command): Same as below. * camel-filter-driver.c (pipe_to_system): Same as below. * camel-gpg-context.c (gpg_ctx_op_start): Use fcntl() to set FD_CLOEXEC on each fd rather than close()ing it. Apparently Linux's older pthread implementations use sockets and so this fouls threading up. GO LINUX! GO! svn path=/trunk/; revision=23527
* Remove mempool code, we use the stuff in e-util. (PRESERVE_HEADERS): newNot Zed2003-11-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-11-13 Not Zed <NotZed@Ximian.com> * camel-mime-parser.c: Remove mempool code, we use the stuff in e-util. (PRESERVE_HEADERS): new compile option, if on, we preserve headers and folding exactly rather than unfolding all input. THIS BREAKS EVERYTHING right now, so don't turn it on. * camel-gpg-context.c (gpg_decrypt): reset the input memstream before passing it to the gpg engine. * tests/smime/pgp-mime.c (main): redirect /dev/null to stdin so it doesn't hang waiting for input. (main): removed from build - this tests multipart/signed explictly, but now the details of this is handled directly by the cipher context. * tests/smime/pgp.c (main): fixes for api changes. (main): redirect /dev/null to stdin so it doesn't hang waiting for input. * tests/message/test1.c (main): update for api changes. * camel-smime-context.c (sm_verify): look at the content object's mime type, not the container's type. svn path=/trunk/; revision=23343
* split out the CMSMessage verification code so it can be used fromNot Zed2003-11-101-32/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-11-10 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (sm_verify_cmsg): split out the CMSMessage verification code so it can be used from enveloped or externally signed data. * camel-cipher-context.c (camel_cipher_verify): only take a mimepart, internally handle multiparts and the hash. 2003-11-07 Not Zed <NotZed@Ximian.com> * camel-cipher-context.c: make ciphervalidity a public structure, added encrypt status. (camel_cipher_decrypt): changed to return a ciphervalidity. fixed implementations. (camel_cipher_validity_*): Fixed implementations to match new structure, some of this is now redundant. 2003-11-06 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (camel_smime_context_describe_part): implement. svn path=/trunk/; revision=23242
* new (unfinished) api to peek inside smime parts to tell us whats in it.Not Zed2003-11-051-22/+80
| | | | | | | | | | | | | | | | | | | | | | | | 2003-11-05 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (camel_smime_context_describe_part): new (unfinished) api to peek inside smime parts to tell us whats in it. 2003-11-03 Not Zed <NotZed@Ximian.com> * camel-gpg-context.c (gpg_encrypt): Make this output the full multipart/encrypted part, not just the encrypted content part. * camel-cipher-context.c (camel_cipher_sign): change to output full mime part, not just a stream. (camel_cipher_canonical_to_stream): utility function to canonicalise a mimepart to a stream. * camel-smime-context.c (sm_encode_cmsmessage): removed. (sm_sign): change interface to output a full mime-part, not just a part of a mime part in multipart/signed mode. svn path=/trunk/; revision=23187
* We might need to convert the passwd from UTF-8 into the locale charset.Jeffrey Stedfast2003-11-051-4/+19
| | | | | | | | | | 2003-11-04 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): We might need to convert the passwd from UTF-8 into the locale charset. Fixes bug #50485. svn path=/trunk/; revision=23186
* Added a note about api inconsistencies.Not Zed2003-10-301-157/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-10-30 Not Zed <NotZed@Ximian.com> * camel-cipher-context.h: Added a note about api inconsistencies. 2003-10-30 Not Zed <NotZed@Ximian.com> * camel-multipart-encrypted.c (camel_multipart_encrypted_decrypt): fix for cipher_decrypt changes. * camel-gpg-context.c, camel-cipher-context.c: moved all the init code to the end to save having to keep forward declarations around. (camel_cipher_decrypt): changed to take mimepart input and return a mimepart. (gpg_decrypt): fix for changed args. 2003-10-29 Not Zed <NotZed@Ximian.com> * camel-smime-context.[ch]: replaced entirely with a new implementation which inherits from camel-cipher-context, and add to build. * camel-multipart-encrypted.c (camel_multipart_encrypted_encrypt): fix for cipher_encrypt api changes. (camel_multipart_encrypted_decrypt): use g_ascii_strcasecmp. * camel-gpg-context.c (gpg_encrypt): Fix to handle input/output as parts not streams * camel-cipher-context.c (camel_cipher_encrypt): change to take mimeparts rather than streams as input/output. And remove the 'sign' argument, it is implied if userid is supplied. 2003-10-28 Not Zed <NotZed@Ximian.com> * tests/smime/pgp.c (main): fix for ciphercontext api changes. * camel-multipart-signed.c (camel_multipart_signed_verify): pass in the part to cipher_verify directly. (camel_multipart_signed_sign): let the cipher context setup the part details. * camel-gpg-context.c (gpg_sign): put the signature stream into a mimepart, with appropriate headers/encoding. (swrite): write out a mimepart rather than a stream. (gpg_verify): handle changed args. * camel-cipher-context.c (camel_cipher_sign): write the signature to a mimepart rather than a simple stream. (camel_cipher_verify): take the signature as a mimepart not a stream. 2003-10-22 Not Zed <NotZed@Ximian.com> * camel-utf8.c (camel_ucs2_utf8, camel_utf8_ucs2): helpers for ucs2 stuff. ucs2 is 16 bit truncated unicode. svn path=/trunk/; revision=23127
* Removed unneeded CAMEL_OBJECT() casts.Jeffrey Stedfast2003-10-241-9/+10
| | | | | | | | 2003-10-23 Jeffrey Stedfast <fejj@ximian.com> * *.c: Removed unneeded CAMEL_OBJECT() casts. svn path=/trunk/; revision=23052
* Don't set seen_eof1 here anymore once we get a trust metric.Jeffrey Stedfast2003-04-231-16/+21
| | | | | | | | | | | | | | | 2003-04-21 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): Don't set seen_eof1 here anymore once we get a trust metric. (gpg_ctx_new): Init seen_eof1 to TRUE here. (gpg_ctx_set_ostream): Change seen_eof1 to FALSE here this way we only ever have to set this if we are expecting output. (gpg_ctx_parse_status): Don't set seen_eof1 for importing either. (gpg_ctx_op_step): Only FD_SET() those fd's that we have not yet finished reading. svn path=/trunk/; revision=20922
* The gpg child process exiting does not necessarily mean that we've readyJeffrey Stedfast2003-04-171-6/+8
| | | | | | | | | | | | | | | | | | | | | | | 2003-04-15 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_verify): The gpg child process exiting does not necessarily mean that we've ready everything that we can from its pipes, so don't use gpg_ctx_op_exited() as a loop-exit condition. If for some reason the gpg child process does exit (due to an error), gpg_ctx_op_step() will eventually fail (as soon as it has finished reading any data in the pipes) and cause the loop to be terminated anyway. This fixes truncation of the gpg --verify stderr output that Evolution displays as the "validity report" (for lack of a better description). (gpg_ctx_op_step): Removed some debugging printf's (gpg_ctx_get_diagnostics): Use a bitfield to decide if we've already flushed the diagnostics stream, much simpler (plus we have plenty of bits to spare so might as well use them). (gpg_ctx_new): Fixed another logic bug which determined whether or not we should convert the gpg output from the locale charset into UTF-8. svn path=/trunk/; revision=20865
* Removed. I just realised that we ALWAYS want to get gpg's stderr in UTF-8,Jeffrey Stedfast2003-04-101-113/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-04-09 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_utf8_diagnostics): Removed. I just realised that we ALWAYS want to get gpg's stderr in UTF-8, so the better solution (plus less code duplication) is to just have the diagnostics buffer be a CamelStreamMem with a charset filter. (gpg_ctx_new): Setup a filter stream to convert our gpg stderr diagnostics into UTF-8 if needed. (gpg_ctx_free): Unref the diagnostcis stream. (gpg_ctx_parse_status): Flush the diagnostics stream if we are going to use the data in an exception. (gpg_ctx_op_step): Use camel_stream_write() to append to the diagnostics stream rather than appending the buffer to a GByteArray like we used to do. (gpg_ctx_op_step): Flush the diagnostics stream here too. (gpg_verify): Use a const char *diagnostics string here, forcing a slight rearrangement of calls - use the const char *dignostics before we gpg_ctx_free, otherwise we'll be passing free'd memory off to the cipher_validity. (gpg_ctx_get_diagnostics): Do the work here to flush the diagnostics stream and nul-terminate the buffer. Also return const now, instead of strdupping. No need for that. (gpg_ctx_parse_status): Convert the user hint to UTF-8. svn path=/trunk/; revision=20798
* Changed my mind a bit on how I wanted this to work. Instead of aborting onJeffrey Stedfast2003-04-101-29/+39
| | | | | | | | | | | | 2003-04-09 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_utf8_diagnostics): Changed my mind a bit on how I wanted this to work. Instead of aborting on an illegal sequence, do like we do with camel-mime-filter-charset and just skip over invalid sequences. Also, in the noop failure case, close the iconv_t so we don't leak it. svn path=/trunk/; revision=20796
* New function to get the UTF-8 version of the diagnostics (if the localeJeffrey Stedfast2003-04-101-3/+75
| | | | | | | | | | | | 2003-04-09 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_utf8_diagnostics): New function to get the UTF-8 version of the diagnostics (if the locale isn't already UTF-8 safe). (gpg_verify): Use the utf-8 diagnostics here. Also fixed a memleak in the exception case. svn path=/trunk/; revision=20792
* Disable debug printf'sJeffrey Stedfast2003-04-081-1/+1
| | | | | | | | 2003-04-07 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c: Disable debug printf's svn path=/trunk/; revision=20733
* remove unused var.Not Zed2003-03-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-03-28 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-store.c (get_folder): remove unused var. * providers/imap/camel-imap-utils.c (imap_parse_list_response): moved an unused var to the #if 0'd out block. * providers/imap/camel-imap-store.c (parse_list_response_as_folder_info): remove unused vars. * camel-index-control.c (main): deifne camel_init() before using it. * camel-vee-store.c (vee_get_folder): removed unused var. * camel-stream-mem.c (stream_write): warning -> fixme. * camel-stream-filter.c (_CamelStreamFilterPrivate): Add a ; to the end of the struct definition. * camel-store.c (camel_store_delete_folder): remove unused var. (camel_store_rename_folder): " (camel_store_unsubscribe_folder): " * camel-mime-part.c (write_to_stream): Changed warning into a TODO. (construct_from_parser): removed warning, the code was fixed. * camel-mime-message.c (construct_from_parser): Remove the warning, the code was fixed. * camel-mime-filter-enriched.c (camel_mime_filter_enriched_new): Remove unused var. * camel-medium.c (camel_medium_get_header): Removed warning, and changed docs to reflect it. * camel-gpg-context.c (gpg_ctx_parse_status): handle MODE_EXPORT as a noop (warning). * camel-folder.c (get_message_user_tag): changed a warning into a fixme (its not that important). (camel_folder_get_message_user_tag): " * camel-data-cache.c (data_cache_finalise): removed unused vars. (data_cache_expire): " svn path=/trunk/; revision=20556
* Same as the gpg and pkcs7 contexts.Jeffrey Stedfast2003-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-02-14 Jeffrey Stedfast <fejj@ximian.com> * camel-smime-context.c (smime_get_password): Same as the gpg and pkcs7 contexts. * camel-sasl-popb4smtp.c (popb4smtp_challenge): Updated for camel_session_get_password(). * camel-pkcs7-context.c (get_password): Same as the gpg code. * camel-gpg-context.c (gpg_ctx_parse_status): Updated for camel_session_get_password(). * providers/smtp/camel-smtp-transport.c (smtp_connect): No need to set USER_CANCEL exception here as it is done by camel_session_get_password(). Also updated for the new get_password() API change. * providers/imap/camel-imap-store.c (imap_auth_loop): Updated for camel_session_get_password() changes. We don't need to play the "bad passwd" game here too, do we? Bah, probably should but I don't feel like it for now. Maybe when we rewrite the IMAP provider. * camel-session.c (camel_session_get_password): Now takes a 'reprompt' argument that will force user-input to be given even if we have the passwd cached. * providers/pop3/camel-pop3-store.c (pop3_connect): Instead of uncaching the passwd after we receive a -ERR from the POP server, set 'reprompt' to TRUE to force user-input for the next password prompt (ie, make sure the front-end knows not to just return the cached value). The front-end can then decide to fill-in the user-input field with the last passwd that the user supplied. (pop3_try_authenticate): Now takes a reprompt argument which we pass into camel_session_get_password(). svn path=/trunk/; revision=19912
* Use g_strerror when setting an exception string (we need it to be inJeffrey Stedfast2002-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Set the virtual method pointers to the import/export methods.Jeffrey Stedfast2002-11-011-15/+149
| | | | | | | | | | | | | | | | | | | | | | 2002-10-31 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (camel_gpg_context_class_init): Set the virtual method pointers to the import/export methods. (camel_gpg_context_init): Set the key_protocol string. (gpg_hash_to_id): Handle 2 more hash types. (gpg_id_to_hash): Same. (gpg_ctx_op_step): Slight fixes to support import/export. (gpg_ctx_parse_status): Fix to hack around the fact that importing keys doesn't write to stdout. (gpg_import_keys): Implemented. (gpg_export_keys): Implemented. * camel-cipher-context.c (camel_cipher_context_class_init): Hook up default virtual methods for import/export. (camel_cipher_import_keys): Implemented. (camel_cipher_export_keys): Implemented. svn path=/trunk/; revision=18475
* Don't prematurely set gpg->complete to TRUE. Let gpg_ctx_op_step () set itJeffrey Stedfast2002-10-281-9/+4
| | | | | | | | | | 2002-10-25 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): Don't prematurely set gpg->complete to TRUE. Let gpg_ctx_op_step () set it to TRUE when gpg closes the status-fd instead. svn path=/trunk/; revision=18448
* No longer takes a path argument. (camel_gpg_context_fianlise): No need toJeffrey Stedfast2002-10-171-29/+8
| | | | | | | | | | | | | | | | | | | | 2002-10-16 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (camel_gpg_context_new): No longer takes a path argument. (camel_gpg_context_fianlise): No need to free ctx->path. (gpg_ctx_new): No longer takes a path argument either. (gpg_ctx_free): No need to free ctx->path, it's no longer used. (gpg_ctx_op_start): Don't stat the path anymore and change the first arg to execvp to "gpg" so that we use the shell's environment to find gpg. (gpg_sign): Updated. (gpg_verify): Updated. (gpg_encrypt): Updated. (gpg_decrypt): Updated. (gpg_ctx_get_argv): Removed some debug printfs. svn path=/trunk/; revision=18383
* If the hash id is NULL, return CAMEL_CIPHER_HASH_DEFAULT. Fixes bugJeffrey Stedfast2002-10-161-8/+10
| | | | | | | | | 2002-10-15 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_id_to_hash): If the hash id is NULL, return CAMEL_CIPHER_HASH_DEFAULT. Fixes bug #32229. svn path=/trunk/; revision=18371
* If the diagnostics are empty, just explain that gpg failed to execute.Jeffrey Stedfast2002-08-201-6/+20
| | | | | | | | | | | 2002-08-19 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_sign): If the diagnostics are empty, just explain that gpg failed to execute. (gpg_encrypt): Same. (gpg_decrypt): And here too. svn path=/trunk/; revision=17807
* Renamed stdin to stdin_fd, stdout to stdout_fd, and stderr to stderr_fd inJeffrey Stedfast2002-07-111-33/+33
| | | | | | | | | | | 2002-07-10 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c: Renamed stdin to stdin_fd, stdout to stdout_fd, and stderr to stderr_fd in struct _GpgCtx since Solaris' stdin/stdout/etderr variables seem to be macros and are thus breaking the compilation. svn path=/trunk/; revision=17409
* Don't use --no-auto-key-retrieve, this option has apparently beenJeffrey Stedfast2002-06-291-4/+10
| | | | | | | | | | 2002-06-28 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_argv): Don't use --no-auto-key-retrieve, this option has apparently been deprecated in gpg 1.0.7. svn path=/trunk/; revision=17321
* Loop on our reads while errno is EINTR or EAGAIN. Also make sure toJeffrey Stedfast2002-06-281-19/+51
| | | | | | | | | | | | | | | | | 2002-06-27 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_op_step): Loop on our reads while errno is EINTR or EAGAIN. Also make sure to completely read stdout and stderr by keeping better state. (gpg_ctx_parse_status): In the case of a NODATA response from gpg, try to use the diagnostics that gpg may have written to its stderr. (gpg_verify): Check that the gpg process has not exited. (gpg_ctx_op_wait): Make sure we haven't already exited (as by gpg_ctx_op_is_exited()) and if we have, retrieve the exit status from the gpg context. svn path=/trunk/; revision=17320
* Loop on our reads while errno is EINTR or EAGAIN. Also make sure toJeffrey Stedfast2002-06-281-3/+10
| | | | | | | | | | | | | 2002-06-27 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_op_step): Loop on our reads while errno is EINTR or EAGAIN. Also make sure to completely read stdout and stderr by keeping better state. (gpg_ctx_parse_status): In the case of a NODATA response from gpg, try to use the diagnostics that gpg may have written to its stderr. svn path=/trunk/; revision=17319
* Loop on our reads while errno is EINTR or EAGAIN. Also make sure toJeffrey Stedfast2002-06-281-22/+18
| | | | | | | | | | 2002-06-27 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_op_step): Loop on our reads while errno is EINTR or EAGAIN. Also make sure to completely read stdout and stderr by keeping better state. svn path=/trunk/; revision=17311
* Loop on our reads while errno is EINTR or EAGAIN.Jeffrey Stedfast2002-06-271-9/+20
| | | | | | | | | 2002-06-27 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_op_step): Loop on our reads while errno is EINTR or EAGAIN. svn path=/trunk/; revision=17307
* Removed (never did anything anyway).Jeffrey Stedfast2002-06-271-13/+0
| | | | | | | | | | | | | | 2002-06-26 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_clearsign): Removed (never did anything anyway). * camel-pgp-context.c (pgp_clearsign): Removed. * camel-cipher-context.c (camel_cipher_clearsign): Removed unused method. svn path=/trunk/; revision=17297
* Check for NODATA too.Jeffrey Stedfast2002-06-271-0/+5
| | | | | | | | | 2002-06-26 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): Check for NODATA too. svn path=/trunk/; revision=17295
* Include <sys/time.h> for struct timeval.Not Zed2002-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-06-26 Not Zed <NotZed@Ximian.com> * camel-gpg-context.c: Include <sys/time.h> for struct timeval. * providers/local/camel-local-provider.c (camel_provider_module_init): Removed spoold provider. The spool provider does it now. 2002-06-25 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-folder.c (camel_spool_folder_new): Support a new xstatus option - folders update/honour the Status/X-Status headers in addition to X-Evolution. * providers/local/camel-local-summary.c (camel_local_summary_write_headers): If supplied with an additional status or xstatus arg, write a Status header and/or X-Status. Also fix the case of properly terminating the headers if an xev line isn't supplied. * providers/local/Makefile.am (libcamellocalinclude_HEADERS,SOURCES): Removed spoold-store.[ch]. * providers/local/camel-local-provider.c (camel_provider_module_init): For the spoold type, just use the spool store instead. * providers/local/camel-spool-store.h: Added a type field, so the 1 store can implement different types without having to subclass. * providers/local/camel-spool-store.c (camel_spool_store_get_toplevel_dir): Removed, inherits from local store now. (construct): If we're pointing to a file, treat it as mbox mode, otherwise treat it as 'elm' mode. (get_folder): Only test for INBOX in mbox mode. (get_folder_info_elm): (get_folder_info_mbox): Two alternatives for getting folder info, depending on the type of folder we're looking at. (get_folder_info_mbox): Make the url include the protocol. (scan_dir): " * providers/local/camel-spoold-store.c (camel_spoold_store_get_toplevel_dir): Removed, inherits from local store now. * camel-folder.c (get_message_user_tag): Dont use a g_return_if_fail for info==NULL. This is not an error. (set_message_user_tag): And same here. (set_message_user_flag): Sigh, and here. (get_message_user_flag): And here. (set_message_flags): and here ... (get_message_flags): Dum de dum, de done at last. * providers/local/camel-mbox-folder.c (mbox_get_message): Check for new messages whenever we retrieve one. In the common no-update case, this is a single stat. (mbox_get_message): If we need to rescan, then force a full rescan to make sure it does the right thing. (mbox_get_message): Cleanup the exception handling a bit, if we do get an error, propagate any folder changes anyway as well. (mbox_set_message_user_flag): Argh more of these stupid g_returns taht shouldn't be. (mbox_set_message_user_tag): Here too. (mbox_set_message_flags): If the read flag is being changed, mark it as an xevchange (i.e. Status line change). * providers/local/camel-mbox-summary.c (summary_rebuild): Merged into summary_update. (summary_update): Changed to allow it to update existing lists of messages without clearing out the summary. (mbox_summary_check): Dont clear the summary, just re-scan. (message_info_new): Attempt to support the 'Status: RO' elm/pine thing. (camel_mbox_summary_encode_status): (camel_mbox_summary_decode_status): Util functions for creating/parsing the Status line. (camel_mbox_summary_sync_mbox): Write out the status line if we're going to try support it. (camel_mbox_summary_xstatus): Implement option to control read/write of (x-)status. (message_info_new): Do x-status stuff based on run-time option. (camel_mbox_summary_sync_mbox): " (mbox_summary_add): If x-status enabled, then always add status/x-status headers to message. * camel-folder-summary.c (summary_assign_uid): If the messageinfo is already in the summary, AND is the same messageinfo, dont do anything, return a value to indicate this. (camel_folder_summary_add): Do nothing if this info already in the summary, so we can perform updates. 2002-06-24 Not Zed <NotZed@Ximian.com> * providers/local/camel-local-summary.c (camel_local_summary_check_force): New method to force the next summary check to be a full check, set if a mismatch occurs. * camel-folder-summary.c (camel_folder_summary_load): If we have no summary path set, dont do any i/o, rather than abort. (camel_folder_summary_save): " (camel_folder_summary_header_load): " * providers/local/camel-spool-store.h: Inherit from camel mbox store, even if we override almost everything. * providers/local/camel-local-folder.c (camel_local_folder_construct): If the base path points to a file, use that as the folder path as well. * providers/local/camel-spool-folder.h: Inherit from camel-mbox-folder. * providers/local/camel-spool-summary.c (spool_summary_sync_full): Use camel_mbox_summary_sync_mbox to do most of the work. * providers/local/camel-spool-summary.[ch]: Make spool-summary inherit from mbox summary rather than foldersummary. * providers/local/camel-mbox-summary.c (mbox_summary_sync): Make sync_full/quick virtual methods. (camel_mbox_summary_sync_mbox): The full sync method put into a simple function that sync's from fd to fd. (mbox_summary_sync_full): Use summary_sync_mbox to do the real work. (mbox_summary_check): Create removed events if the folder gets cleared. Also, dont clear the summary before a rebuild, try to merge. svn path=/trunk/; revision=17284
* #include <sys/time.h>Jeffrey Stedfast2002-06-261-0/+1
| | | | | | | | 2002-06-25 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c: #include <sys/time.h> svn path=/trunk/; revision=17283
* Return the option as --digest-algo=<micalg> (gpg_ctx_parse_status): DecodeJeffrey Stedfast2002-06-251-20/+70
| | | | | | | | | | | | | | | | 2002-06-25 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_hash_str): Return the option as --digest-algo=<micalg> (gpg_ctx_parse_status): Decode more status information and keep track of trust and such. (gpg_ctx_op_complete): Make sure we aren't waiting for gpg to write data to stdout (such as encrypted/decrypted data or a signature). (gpg_encrypt): Remove the fejj@stampede.org hard-coded value (which had only meant to be for testing). svn path=/trunk/; revision=17271
* implemented camel_gpg_context_set_always_trust()Jeffrey Stedfast2002-06-251-0/+18
| | | | svn path=/trunk/; revision=17269
* Use --command-fd rather than --passphrase-fd since what we really want isJeffrey Stedfast2002-06-251-1/+6
| | | | | | | | | | | | | 2002-06-24 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_argv): Use --command-fd rather than --passphrase-fd since what we really want is an interactive mode (besides, --passphrase-fd requires a passphrase to be sent before --status-fd will send a NEED_PASSPHRASE status message). (gpg_ctx_parse_status): When we encounter a BAD_PASSPHRASE, tell the session to uncache it. svn path=/trunk/; revision=17268
* Use --command-fd rather than --passphrase-fd since what we really want isJeffrey Stedfast2002-06-251-100/+69
| | | | | | | | | | | 2002-06-24 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_argv): Use --command-fd rather than --passphrase-fd since what we really want is an interactive mode (besides, --passphrase-fd requires a passphrase to be sent before --status-fd will send a NEED_PASSPHRASE status message). svn path=/trunk/; revision=17267
* Check for ERRSIG also. (gpg_ctx_op_step): Don't try writing a passphraseJeffrey Stedfast2002-06-241-6/+7
| | | | | | | | | | | 2002-06-23 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_parse_status): Check for ERRSIG also. (gpg_ctx_op_step): Don't try writing a passphrase unless our operation requires it. svn path=/trunk/; revision=17263
* Return -1 on error. (gpg_decrypt): Same. (gpg_sign): Again here.Jeffrey Stedfast2002-06-231-56/+105
| | | | | | | | | | | | | | | 2002-06-22 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_encrypt): Return -1 on error. (gpg_decrypt): Same. (gpg_sign): Again here. (gpg_ctx_op_step): Only attenmpt to read from the status-fd if we are not already 'complete'. * camel-pgp-mime.c (camel_pgp_mime_part_encrypt): Flush the filtered stream. svn path=/trunk/; revision=17257
* more fixes, now verifying works and signing almost works as well, except gpg ↵Jeffrey Stedfast2002-06-221-7/+30
| | | | | | is running out of memory for me? not sure if that is a gpg or evo bug svn path=/trunk/; revision=17256
* yay, I get to hold more state because Unix pipes suck so badly. This isJeffrey Stedfast2002-06-221-101/+220
| | | | | | | | getting very close to working now... I think that as soon as I debug this segfault, it will work. Probably dereferencing a NULL pointer or something stupid like that. svn path=/trunk/; revision=17255
* added camel_gpg_context_new which I had forgotten beforeJeffrey Stedfast2002-06-221-0/+28
| | | | svn path=/trunk/; revision=17252
* New source files implementing the CamelCipherContext class for gnupg.Jeffrey Stedfast2002-06-221-0/+1179
2002-06-21 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.[c,h]: New source files implementing the CamelCipherContext class for gnupg. * camel-pgp-context.c (camel_pgp_context_new): Return a CamelCipherContext. * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): Take a CamelCipherContext argument rather than a CamelPgpContext since we now have a CamelGpgContext also. (camel_pgp_mime_part_encrypt): Same. (camel_pgp_mime_part_verify): Same. (camel_pgp_mime_part_sign): Same. svn path=/trunk/; revision=17251