1894{
1896 const char *prompt = NULL;
1897 const char *letters = NULL;
1898 const char *choices = NULL;
1899 char promptbuf[1024] = { 0 };
1900 int choice;
1901
1904
1905
1907 if (c_pgp_auto_inline &&
1909 {
1911 }
1912
1914
1915 char *mime_inline = NULL;
1917 {
1918
1919
1920 mime_inline =
_(
"PGP/M(i)ME");
1921 }
1922 else
1923 {
1924
1925
1926 mime_inline =
_(
"(i)nline");
1927 }
1928
1929
1930
1931
1934 {
1936 {
1937 snprintf(promptbuf, sizeof(promptbuf),
1938
1939 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1940 mime_inline);
1941 prompt = promptbuf;
1942
1943
1944 letters =
_(
"saico");
1945 choices = "SaiCo";
1946 }
1947 else
1948 {
1949
1950 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1951
1952 letters =
_(
"saco");
1953 choices = "SaCo";
1954 }
1955 }
1956 else if (c_crypt_opportunistic_encrypt)
1957 {
1958
1959
1960
1961
1963 {
1964 snprintf(promptbuf, sizeof(promptbuf),
1965
1966 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1967 mime_inline);
1968 prompt = promptbuf;
1969
1970
1971 letters =
_(
"esabico");
1972 choices = "esabicO";
1973 }
1974 else
1975 {
1976
1977 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1978
1979 letters =
_(
"esabco");
1980 choices = "esabcO";
1981 }
1982 }
1983 else
1984 {
1985
1987 {
1988 snprintf(promptbuf, sizeof(promptbuf),
1989
1990 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
1991 mime_inline);
1992 prompt = promptbuf;
1993
1994
1995 letters =
_(
"esabic");
1996 choices = "esabic";
1997 }
1998 else
1999 {
2000
2001 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2002
2003 letters =
_(
"esabc");
2004 choices = "esabc";
2005 }
2006 }
2007
2009 if (choice > 0)
2010 {
2011 switch (choices[choice - 1])
2012 {
2013 case 'a':
2015
2017 if (p)
2018 {
2019 char input_signas[128] = { 0 };
2023
2025
2027 }
2028 break;
2029
2030 case 'b':
2032 break;
2033
2034 case 'C':
2036 break;
2037
2038 case 'c':
2040 break;
2041
2042 case 'e':
2045 break;
2046
2047 case 'i':
2049 break;
2050
2051 case 'O':
2054 break;
2055
2056 case 'o':
2058 break;
2059
2060 case 'S':
2062 break;
2063
2064 case 's':
2067 break;
2068 }
2069 }
2070
2072}
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.