1897{
1899 const char *prompt = NULL;
1900 const char *letters = NULL;
1901 const char *choices = NULL;
1902 char promptbuf[1024] = { 0 };
1903 int choice;
1904
1907
1908
1910 if (c_pgp_auto_inline &&
1912 {
1914 }
1915
1917
1918 char *mime_inline = NULL;
1920 {
1921
1922
1923 mime_inline =
_(
"PGP/M(i)ME");
1924 }
1925 else
1926 {
1927
1928
1929 mime_inline =
_(
"(i)nline");
1930 }
1931
1932
1933
1934
1937 {
1939 {
1940 snprintf(promptbuf, sizeof(promptbuf),
1941
1942 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1943 mime_inline);
1944 prompt = promptbuf;
1945
1946
1947 letters =
_(
"saico");
1948 choices = "SaiCo";
1949 }
1950 else
1951 {
1952
1953 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1954
1955 letters =
_(
"saco");
1956 choices = "SaCo";
1957 }
1958 }
1959 else if (c_crypt_opportunistic_encrypt)
1960 {
1961
1962
1963
1964
1966 {
1967 snprintf(promptbuf, sizeof(promptbuf),
1968
1969 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1970 mime_inline);
1971 prompt = promptbuf;
1972
1973
1974 letters =
_(
"esabico");
1975 choices = "esabicO";
1976 }
1977 else
1978 {
1979
1980 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1981
1982 letters =
_(
"esabco");
1983 choices = "esabcO";
1984 }
1985 }
1986 else
1987 {
1988
1990 {
1991 snprintf(promptbuf, sizeof(promptbuf),
1992
1993 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1994 mime_inline);
1995 prompt = promptbuf;
1996
1997
1998 letters =
_(
"esabic");
1999 choices = "esabic";
2000 }
2001 else
2002 {
2003
2004 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2005
2006 letters =
_(
"esabc");
2007 choices = "esabc";
2008 }
2009 }
2010
2012 if (choice > 0)
2013 {
2014 switch (choices[choice - 1])
2015 {
2016 case 'a':
2018
2020 if (p)
2021 {
2022 char input_signas[128] = { 0 };
2026
2028
2030 }
2031 break;
2032
2033 case 'b':
2035 break;
2036
2037 case 'C':
2039 break;
2040
2041 case 'c':
2043 break;
2044
2045 case 'e':
2048 break;
2049
2050 case 'i':
2052 break;
2053
2054 case 'O':
2057 break;
2058
2059 case 'o':
2061 break;
2062
2063 case 'S':
2065 break;
2066
2067 case 's':
2070 break;
2071 }
2072 }
2073
2075}
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 -.
#define SEC_INLINE
Email has an inline signature.
#define SEC_OPPENCRYPT
Opportunistic encrypt mode.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define KEYFLAG_NO_FLAGS
No flags are set.
#define SEC_ENCRYPT
Email is encrypted.
#define SEC_SIGN
Email is signed.
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.