1930{
1932 const char *prompt = NULL;
1933 const char *letters = NULL;
1934 const char *choices = NULL;
1935 char promptbuf[1024] = { 0 };
1936 int choice;
1937
1940
1941
1943 if (c_pgp_auto_inline &&
1945 {
1947 }
1948
1950
1951 char *mime_inline = NULL;
1953 {
1954
1955
1956 mime_inline =
_(
"PGP/M(i)ME");
1957 }
1958 else
1959 {
1960
1961
1962 mime_inline =
_(
"(i)nline");
1963 }
1964
1965
1966
1967
1970 {
1972 {
1973 snprintf(promptbuf, sizeof(promptbuf),
1974
1975 _(
"PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off?"),
1976 mime_inline);
1977 prompt = promptbuf;
1978
1979
1980 letters =
_(
"saico");
1981 choices = "SaiCo";
1982 }
1983 else
1984 {
1985
1986 prompt =
_(
"PGP (s)ign, sign (a)s, (c)lear, or (o)ppenc mode off?");
1987
1988 letters =
_(
"saco");
1989 choices = "SaCo";
1990 }
1991 }
1992 else if (c_crypt_opportunistic_encrypt)
1993 {
1994
1995
1996
1997
1999 {
2000 snprintf(promptbuf, sizeof(promptbuf),
2001
2002 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode?"),
2003 mime_inline);
2004 prompt = promptbuf;
2005
2006
2007 letters =
_(
"esabico");
2008 choices = "esabicO";
2009 }
2010 else
2011 {
2012
2013 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (c)lear, or (o)ppenc mode?");
2014
2015 letters =
_(
"esabco");
2016 choices = "esabcO";
2017 }
2018 }
2019 else
2020 {
2021
2023 {
2024 snprintf(promptbuf, sizeof(promptbuf),
2025
2026 _(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear?"),
2027 mime_inline);
2028 prompt = promptbuf;
2029
2030
2031 letters =
_(
"esabic");
2032 choices = "esabic";
2033 }
2034 else
2035 {
2036
2037 prompt =
_(
"PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (c)lear?");
2038
2039 letters =
_(
"esabc");
2040 choices = "esabc";
2041 }
2042 }
2043
2045 if (choice > 0)
2046 {
2047 switch (choices[choice - 1])
2048 {
2049 case 'a':
2051
2053 if (p)
2054 {
2055 char input_signas[128] = { 0 };
2059
2061
2063 }
2064 break;
2065
2066 case 'b':
2068 break;
2069
2070 case 'C':
2072 break;
2073
2074 case 'c':
2076 break;
2077
2078 case 'e':
2081 break;
2082
2083 case 'i':
2085 break;
2086
2087 case 'O':
2090 break;
2091
2092 case 'o':
2094 break;
2095
2096 case 'S':
2098 break;
2099
2100 case 's':
2103 break;
2104
2105 default:
2106 break;
2107 }
2108 }
2109
2111}
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.