1878{
1880 const char *prompt = NULL;
1881 const char *letters = NULL;
1882 const char *choices = NULL;
1883 char promptbuf[1024] = { 0 };
1884 int choice;
1885
1888
1889
1891 if (c_pgp_auto_inline &&
1893 {
1895 }
1896
1898
1899 char *mime_inline = NULL;
1901 {
1902
1903
1904 mime_inline =
_(
"PGP/M(i)ME");
1905 }
1906 else
1907 {
1908
1909
1910 mime_inline =
_(
"(i)nline");
1911 }
1912
1913
1914
1915
1918 {
1920 {
1921 snprintf(promptbuf, sizeof(promptbuf),
1922
1923 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1924 mime_inline);
1925 prompt = promptbuf;
1926
1927
1928 letters =
_(
"saico");
1929 choices = "SaiCo";
1930 }
1931 else
1932 {
1933
1934 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1935
1936 letters =
_(
"saco");
1937 choices = "SaCo";
1938 }
1939 }
1940
1941
1942 else if (c_crypt_opportunistic_encrypt)
1943 {
1944
1945
1947 {
1948 snprintf(promptbuf, sizeof(promptbuf),
1949
1950 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1951 mime_inline);
1952 prompt = promptbuf;
1953
1954
1955 letters =
_(
"esabico");
1956 choices = "esabicO";
1957 }
1958 else
1959 {
1960
1961 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1962
1963 letters =
_(
"esabco");
1964 choices = "esabcO";
1965 }
1966 }
1967
1968 else
1969 {
1971 {
1972 snprintf(promptbuf, sizeof(promptbuf),
1973
1974 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1975 mime_inline);
1976 prompt = promptbuf;
1977
1978
1979 letters =
_(
"esabic");
1980 choices = "esabic";
1981 }
1982 else
1983 {
1984
1985 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
1986
1987 letters =
_(
"esabc");
1988 choices = "esabc";
1989 }
1990 }
1991
1993 if (choice > 0)
1994 {
1995 switch (choices[choice - 1])
1996 {
1997 case 'a':
1999
2001 if (p)
2002 {
2003 char input_signas[128] = { 0 };
2007
2009
2011 }
2012 break;
2013
2014 case 'b':
2016 break;
2017
2018 case 'C':
2020 break;
2021
2022 case 'c':
2024 break;
2025
2026 case 'e':
2029 break;
2030
2031 case 'i':
2033 break;
2034
2035 case 'O':
2038 break;
2039
2040 case 'o':
2042 break;
2043
2044 case 'S':
2046 break;
2047
2048 case 's':
2051 break;
2052 }
2053 }
2054
2056}
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()
#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.
bool OptPgpCheckTrust
(pseudo) used by dlg_select_pgp_key()
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
struct PgpKeyInfo * pgp_ask_for_key(char *tag, 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.
int mutt_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question.
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.