1913{
1915 const char *prompt = NULL;
1916 const char *letters = NULL;
1917 const char *choices = NULL;
1918 char promptbuf[1024] = { 0 };
1919 int choice;
1920
1923
1924
1926 if (c_pgp_auto_inline &&
1928 {
1930 }
1931
1933
1934 char *mime_inline = NULL;
1936 {
1937
1938
1939 mime_inline =
_(
"PGP/M(i)ME");
1940 }
1941 else
1942 {
1943
1944
1945 mime_inline =
_(
"(i)nline");
1946 }
1947
1948
1949
1950
1953 {
1955 {
1956 snprintf(promptbuf, sizeof(promptbuf),
1957
1958 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1959 mime_inline);
1960 prompt = promptbuf;
1961
1962
1963 letters =
_(
"saico");
1964 choices = "SaiCo";
1965 }
1966 else
1967 {
1968
1969 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1970
1971 letters =
_(
"saco");
1972 choices = "SaCo";
1973 }
1974 }
1975 else if (c_crypt_opportunistic_encrypt)
1976 {
1977
1978
1979
1980
1982 {
1983 snprintf(promptbuf, sizeof(promptbuf),
1984
1985 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
1986 mime_inline);
1987 prompt = promptbuf;
1988
1989
1990 letters =
_(
"esabico");
1991 choices = "esabicO";
1992 }
1993 else
1994 {
1995
1996 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
1997
1998 letters =
_(
"esabco");
1999 choices = "esabcO";
2000 }
2001 }
2002 else
2003 {
2004
2006 {
2007 snprintf(promptbuf, sizeof(promptbuf),
2008
2009 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
2010 mime_inline);
2011 prompt = promptbuf;
2012
2013
2014 letters =
_(
"esabic");
2015 choices = "esabic";
2016 }
2017 else
2018 {
2019
2020 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2021
2022 letters =
_(
"esabc");
2023 choices = "esabc";
2024 }
2025 }
2026
2028 if (choice > 0)
2029 {
2030 switch (choices[choice - 1])
2031 {
2032 case 'a':
2034
2036 if (p)
2037 {
2038 char input_signas[128] = { 0 };
2042
2044
2046 }
2047 break;
2048
2049 case 'b':
2051 break;
2052
2053 case 'C':
2055 break;
2056
2057 case 'c':
2059 break;
2060
2061 case 'e':
2064 break;
2065
2066 case 'i':
2068 break;
2069
2070 case 'O':
2073 break;
2074
2075 case 'o':
2077 break;
2078
2079 case 'S':
2081 break;
2082
2083 case 's':
2086 break;
2087 }
2088 }
2089
2091}
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 -.
@ SEC_OPPENCRYPT
Opportunistic encrypt mode.
@ SEC_SIGN
Email is signed.
@ SEC_INLINE
Email has an inline signature.
@ SEC_ENCRYPT
Email is encrypted.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
@ KEYFLAG_NONE
No flags are set.
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.