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