1899{
1901 const char *prompt = NULL;
1902 const char *letters = NULL;
1903 const char *choices = NULL;
1904 char promptbuf[1024] = { 0 };
1905 int choice;
1906
1909
1910
1912 if (c_pgp_auto_inline &&
1914 {
1916 }
1917
1919
1920 char *mime_inline = NULL;
1922 {
1923
1924
1925 mime_inline =
_(
"PGP/M(i)ME");
1926 }
1927 else
1928 {
1929
1930
1931 mime_inline =
_(
"(i)nline");
1932 }
1933
1934
1935
1936
1939 {
1941 {
1942 snprintf(promptbuf, sizeof(promptbuf),
1943
1944 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1945 mime_inline);
1946 prompt = promptbuf;
1947
1948
1949 letters =
_(
"saico");
1950 choices = "SaiCo";
1951 }
1952 else
1953 {
1954
1955 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1956
1957 letters =
_(
"saco");
1958 choices = "SaCo";
1959 }
1960 }
1961 else if (c_crypt_opportunistic_encrypt)
1962 {
1963
1964
1965
1966
1968 {
1969 snprintf(promptbuf, sizeof(promptbuf),
1970
1971 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1972 mime_inline);
1973 prompt = promptbuf;
1974
1975
1976 letters =
_(
"esabico");
1977 choices = "esabicO";
1978 }
1979 else
1980 {
1981
1982 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1983
1984 letters =
_(
"esabco");
1985 choices = "esabcO";
1986 }
1987 }
1988 else
1989 {
1990
1992 {
1993 snprintf(promptbuf, sizeof(promptbuf),
1994
1995 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1996 mime_inline);
1997 prompt = promptbuf;
1998
1999
2000 letters =
_(
"esabic");
2001 choices = "esabic";
2002 }
2003 else
2004 {
2005
2006 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2007
2008 letters =
_(
"esabc");
2009 choices = "esabc";
2010 }
2011 }
2012
2014 if (choice > 0)
2015 {
2016 switch (choices[choice - 1])
2017 {
2018 case 'a':
2020
2022 if (p)
2023 {
2024 char input_signas[128] = { 0 };
2028
2030
2032 }
2033 break;
2034
2035 case 'b':
2037 break;
2038
2039 case 'C':
2041 break;
2042
2043 case 'c':
2045 break;
2046
2047 case 'e':
2050 break;
2051
2052 case 'i':
2054 break;
2055
2056 case 'O':
2059 break;
2060
2061 case 'o':
2063 break;
2064
2065 case 'S':
2067 break;
2068
2069 case 's':
2072 break;
2073 }
2074 }
2075
2077}
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.