1934{
1936 const char *prompt = NULL;
1937 const char *letters = NULL;
1938 const char *choices = NULL;
1939 char promptbuf[1024] = { 0 };
1940 int choice;
1941
1944
1945
1947 if (c_pgp_auto_inline &&
1949 {
1951 }
1952
1954
1955 char *mime_inline = NULL;
1957 {
1958
1959
1960 mime_inline =
_(
"PGP/M(i)ME");
1961 }
1962 else
1963 {
1964
1965
1966 mime_inline =
_(
"(i)nline");
1967 }
1968
1969
1970
1971
1974 {
1976 {
1977 snprintf(promptbuf, sizeof(promptbuf),
1978
1979 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1980 mime_inline);
1981 prompt = promptbuf;
1982
1983
1984 letters =
_(
"saico");
1985 choices = "SaiCo";
1986 }
1987 else
1988 {
1989
1990 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1991
1992 letters =
_(
"saco");
1993 choices = "SaCo";
1994 }
1995 }
1996 else if (c_crypt_opportunistic_encrypt)
1997 {
1998
1999
2000
2001
2003 {
2004 snprintf(promptbuf, sizeof(promptbuf),
2005
2006 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
2007 mime_inline);
2008 prompt = promptbuf;
2009
2010
2011 letters =
_(
"esabico");
2012 choices = "esabicO";
2013 }
2014 else
2015 {
2016
2017 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
2018
2019 letters =
_(
"esabco");
2020 choices = "esabcO";
2021 }
2022 }
2023 else
2024 {
2025
2027 {
2028 snprintf(promptbuf, sizeof(promptbuf),
2029
2030 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
2031 mime_inline);
2032 prompt = promptbuf;
2033
2034
2035 letters =
_(
"esabic");
2036 choices = "esabic";
2037 }
2038 else
2039 {
2040
2041 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2042
2043 letters =
_(
"esabc");
2044 choices = "esabc";
2045 }
2046 }
2047
2049 if (choice > 0)
2050 {
2051 switch (choices[choice - 1])
2052 {
2053 case 'a':
2055
2057 if (p)
2058 {
2059 char input_signas[128] = { 0 };
2063
2065
2067 }
2068 break;
2069
2070 case 'b':
2072 break;
2073
2074 case 'C':
2076 break;
2077
2078 case 'c':
2080 break;
2081
2082 case 'e':
2085 break;
2086
2087 case 'i':
2089 break;
2090
2091 case 'O':
2094 break;
2095
2096 case 'o':
2098 break;
2099
2100 case 'S':
2102 break;
2103
2104 case 's':
2107 break;
2108
2109 default:
2110 break;
2111 }
2112 }
2113
2115}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
void crypt_opportunistic_encrypt(struct Email *e)
Can all recipients be determined.
void crypt_pgp_void_passphrase(void)
Wrapper for CryptModuleSpecs::void_passphrase().
bool OptPgpCheckTrust
(pseudo) used by dlg_pgp()
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
@ SEC_OPPENCRYPT
Opportunistic encrypt mode.
@ SEC_SIGN
Email is signed.
@ SEC_INLINE
Email has an inline signature.
@ SEC_ENCRYPT
Email is encrypted.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
@ KEYFLAG_NONE
No flags are set.
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
struct PgpKeyInfo * pgp_ask_for_key(char *tag, const char *whatfor, KeyFlags abilities, enum PgpRing keyring)
Ask the user for a PGP key.
@ PGP_SECRING
Secret keys.
void pgp_key_free(struct PgpKeyInfo **kpp)
Free a PGP key info.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Information about a PGP key.
int cs_subset_str_string_set(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Set a config item by string.