aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-27 05:14:09 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-27 05:14:09 +0800
commit47400a031c1baef26a00584095ae647bc58dcecf (patch)
treeba062ffc93420ef045434d6507003e2eddd170c1 /mail/mail-config.c
parent26fb05c8cb7db57e500945ee5546e52363f2e4a6 (diff)
downloadgsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.tar
gsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.tar.gz
gsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.tar.bz2
gsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.tar.lz
gsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.tar.xz
gsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.tar.zst
gsoc2013-evolution-47400a031c1baef26a00584095ae647bc58dcecf.zip
Don't allow the pgp type to be anything except NONE or GPG.
2002-06-26 Jeffrey Stedfast <fejj@ximian.com> * mail-config.c (config_read): Don't allow the pgp type to be anything except NONE or GPG. * mail-preferences.c (mail_preferences_apply): Don't allow someone to use anything other than GnuPG. * mail-crypto.c (mail_crypto_get_pgp_cipher_context): No need to handle pgp5 or pgp6 types anymore since we are no longer supporting them. Ding dong the witch is dead! * mail-format.c (handle_multipart_encrypted): Rewritten to use camel_multipart_encrypted_decrypt. * mail-crypto.c (mail_crypto_pgp_mime_part_verify): Removed. (mail_crypto_pgp_mime_part_encrypt): Removed. (mail_crypto_pgp_mime_part_decrypt): Are we seeing a trend yet? svn path=/trunk/; revision=17301
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 4c2192cf40..ed9a9be18f 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -888,11 +888,17 @@ config_read (void)
config->db, "/Mail/Prompts/confirm_goto_next_folder", TRUE, NULL);
/* PGP/GPG */
- config->pgp_path = bonobo_config_get_string (config->db,
- "/Mail/PGP/path", NULL);
+ config->pgp_path = bonobo_config_get_string (config->db, "/Mail/PGP/path", NULL);
config->pgp_type = bonobo_config_get_long_with_default (config->db,
- "/Mail/PGP/type", CAMEL_PGP_TYPE_NONE, NULL);
+ "/Mail/PGP/type", CONFIG_PGP_TYPE_NONE, NULL);
+
+ /* we only support GnuPG now */
+ if (config->pgp_type != CONFIG_PGP_TYPE_GPG) {
+ config->pgp_type = CONFIG_PGP_TYPE_NONE;
+ g_free (config->pgp_path);
+ config->pgp_path = NULL;
+ }
/* HTTP images */
config->http_mode = bonobo_config_get_long_with_default (config->db,
@@ -1760,13 +1766,13 @@ mail_config_set_goto_next_folder (gboolean value)
struct {
char *bin;
char *version;
- CamelPgpType type;
+ int type;
} binaries[] = {
- { "gpg", NULL, CAMEL_PGP_TYPE_GPG },
- { "pgp", "6.5.8", CAMEL_PGP_TYPE_PGP6 },
- { "pgp", "5.0", CAMEL_PGP_TYPE_PGP5 },
- { "pgp", "2.6", CAMEL_PGP_TYPE_PGP2 },
- { NULL, NULL, CAMEL_PGP_TYPE_NONE }
+ { "gpg", NULL, CONFIG_PGP_TYPE_GPG },
+ { "pgp", "6.5.8", CONFIG_PGP_TYPE_PGP6 },
+ { "pgp", "5.0", CONFIG_PGP_TYPE_PGP5 },
+ { "pgp", "2.6", CONFIG_PGP_TYPE_PGP2 },
+ { NULL, NULL, CONFIG_PGP_TYPE_NONE }
};
@@ -1909,7 +1915,7 @@ pgpclose (PGPFILE *pgp)
return -1;
}
-CamelPgpType
+int
mail_config_pgp_type_detect_from_path (const char *pgp)
{
const char *bin = g_basename (pgp);
@@ -1918,7 +1924,7 @@ mail_config_pgp_type_detect_from_path (const char *pgp)
/* make sure the file exists *and* is executable? */
if (stat (pgp, &st) == -1 || !(st.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)))
- return CAMEL_PGP_TYPE_NONE;
+ return CONFIG_PGP_TYPE_NONE;
for (i = 0; binaries[i].bin; i++) {
if (binaries[i].version) {
@@ -1948,13 +1954,13 @@ mail_config_pgp_type_detect_from_path (const char *pgp)
}
}
- return CAMEL_PGP_TYPE_NONE;
+ return CONFIG_PGP_TYPE_NONE;
}
static void
auto_detect_pgp_variables (void)
{
- CamelPgpType type = CAMEL_PGP_TYPE_NONE;
+ int type = CONFIG_PGP_TYPE_NONE;
const char *PATH, *path;
char *pgp = NULL;
@@ -2034,7 +2040,7 @@ auto_detect_pgp_variables (void)
g_free (pgp);
}
-CamelPgpType
+int
mail_config_get_pgp_type (void)
{
if (!config->pgp_path || !config->pgp_type)
@@ -2044,7 +2050,7 @@ mail_config_get_pgp_type (void)
}
void
-mail_config_set_pgp_type (CamelPgpType pgp_type)
+mail_config_set_pgp_type (int pgp_type)
{
config->pgp_type = pgp_type;
}