1893{
1895 const char *prompt = NULL;
1896 const char *letters = NULL;
1897 const char *choices = NULL;
1898 char promptbuf[1024] = { 0 };
1899 int choice;
1900
1903
1904
1906 if (c_pgp_auto_inline &&
1908 {
1910 }
1911
1913
1914 char *mime_inline = NULL;
1916 {
1917
1918
1919 mime_inline =
_(
"PGP/M(i)ME");
1920 }
1921 else
1922 {
1923
1924
1925 mime_inline =
_(
"(i)nline");
1926 }
1927
1928
1929
1930
1933 {
1935 {
1936 snprintf(promptbuf, sizeof(promptbuf),
1937
1938 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1939 mime_inline);
1940 prompt = promptbuf;
1941
1942
1943 letters =
_(
"saico");
1944 choices = "SaiCo";
1945 }
1946 else
1947 {
1948
1949 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1950
1951 letters =
_(
"saco");
1952 choices = "SaCo";
1953 }
1954 }
1955 else if (c_crypt_opportunistic_encrypt)
1956 {
1957
1958
1959
1960
1962 {
1963 snprintf(promptbuf, sizeof(promptbuf),
1964
1965 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1966 mime_inline);
1967 prompt = promptbuf;
1968
1969
1970 letters =
_(
"esabico");
1971 choices = "esabicO";
1972 }
1973 else
1974 {
1975
1976 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1977
1978 letters =
_(
"esabco");
1979 choices = "esabcO";
1980 }
1981 }
1982 else
1983 {
1984
1986 {
1987 snprintf(promptbuf, sizeof(promptbuf),
1988
1989 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1990 mime_inline);
1991 prompt = promptbuf;
1992
1993
1994 letters =
_(
"esabic");
1995 choices = "esabic";
1996 }
1997 else
1998 {
1999
2000 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2001
2002 letters =
_(
"esabc");
2003 choices = "esabc";
2004 }
2005 }
2006
2008 if (choice > 0)
2009 {
2010 switch (choices[choice - 1])
2011 {
2012 case 'a':
2014
2016 if (p)
2017 {
2018 char input_signas[128] = { 0 };
2022
2024
2026 }
2027 break;
2028
2029 case 'b':
2031 break;
2032
2033 case 'C':
2035 break;
2036
2037 case 'c':
2039 break;
2040
2041 case 'e':
2044 break;
2045
2046 case 'i':
2048 break;
2049
2050 case 'O':
2053 break;
2054
2055 case 'o':
2057 break;
2058
2059 case 'S':
2061 break;
2062
2063 case 's':
2066 break;
2067 }
2068 }
2069
2071}
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.