|
void | pgp_class_void_passphrase (void) |
| Implements CryptModuleSpecs::void_passphrase() -. More...
|
|
bool | pgp_class_valid_passphrase (void) |
| Implements CryptModuleSpecs::valid_passphrase() -. More...
|
|
bool | pgp_use_gpg_agent (void) |
| Does the user want to use the gpg agent? More...
|
|
static struct PgpKeyInfo * | key_parent (struct PgpKeyInfo *k) |
| Find a key's parent (if it's a subkey) More...
|
|
char * | pgp_long_keyid (struct PgpKeyInfo *k) |
| Get a key's long id. More...
|
|
char * | pgp_short_keyid (struct PgpKeyInfo *k) |
| Get a key's short id. More...
|
|
char * | pgp_this_keyid (struct PgpKeyInfo *k) |
| Get the ID of this key. More...
|
|
char * | pgp_keyid (struct PgpKeyInfo *k) |
| Get the ID of the main (parent) key. More...
|
|
static char * | pgp_fingerprint (struct PgpKeyInfo *k) |
| Get the key's fingerprint. More...
|
|
char * | pgp_fpr_or_lkeyid (struct PgpKeyInfo *k) |
| Get the fingerprint or long keyid. More...
|
|
static int | pgp_copy_checksig (FILE *fp_in, FILE *fp_out) |
| Copy PGP output and look for signs of a good signature. More...
|
|
static int | pgp_check_pgp_decryption_okay_regex (FILE *fp_in) |
| Check PGP output to look for successful outcome. More...
|
|
static int | pgp_check_decryption_okay (FILE *fp_in) |
| Check GPG output for status codes. More...
|
|
static void | pgp_copy_clearsigned (FILE *fp_in, struct State *s, char *charset) |
| Copy a clearsigned message, stripping the signature. More...
|
|
int | pgp_class_application_handler (struct Body *m, struct State *s) |
| Implements CryptModuleSpecs::application_handler() -. More...
|
|
static bool | pgp_check_traditional_one_body (FILE *fp, struct Body *b) |
| Check the body of an inline PGP message. More...
|
|
bool | pgp_class_check_traditional (FILE *fp, struct Body *b, bool just_one) |
| Implements CryptModuleSpecs::pgp_check_traditional() -. More...
|
|
int | pgp_class_verify_one (struct Body *sigbdy, struct State *s, const char *tempfile) |
| Implements CryptModuleSpecs::verify_one() -. More...
|
|
static void | pgp_extract_keys_from_attachment (FILE *fp, struct Body *top) |
| Extract pgp keys from messages/attachments. More...
|
|
void | pgp_class_extract_key_from_attachment (FILE *fp, struct Body *top) |
| Implements CryptModuleSpecs::pgp_extract_key_from_attachment() -. More...
|
|
static struct Body * | pgp_decrypt_part (struct Body *a, struct State *s, FILE *fp_out, struct Body *p) |
| Decrypt part of a PGP message. More...
|
|
int | pgp_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur) |
| Implements CryptModuleSpecs::decrypt_mime() -. More...
|
|
int | pgp_class_encrypted_handler (struct Body *a, struct State *s) |
| Implements CryptModuleSpecs::encrypted_handler() -. More...
|
|
struct Body * | pgp_class_sign_message (struct Body *a, const struct AddressList *from) |
| Implements CryptModuleSpecs::sign_message() -. More...
|
|
char * | pgp_class_find_keys (const struct AddressList *addrlist, bool oppenc_mode) |
| Implements CryptModuleSpecs::find_keys() -. More...
|
|
struct Body * | pgp_class_encrypt_message (struct Body *a, char *keylist, bool sign, const struct AddressList *from) |
| Implements CryptModuleSpecs::pgp_encrypt_message() -. More...
|
|
struct Body * | pgp_class_traditional_encryptsign (struct Body *a, SecurityFlags flags, char *keylist) |
| Implements CryptModuleSpecs::pgp_traditional_encryptsign() -. More...
|
|
SecurityFlags | pgp_class_send_menu (struct Email *e) |
| Implements CryptModuleSpecs::send_menu() -. More...
|
|
PGP sign, encrypt, check routines.
- Authors
- Michael R. Elkins
- Thomas Roessler
- g10 Code GmbH
- Pietro Cerutti
- Copyright
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file pgp.c.
static int pgp_check_decryption_okay |
( |
FILE * |
fp_in | ) |
|
|
static |
Check GPG output for status codes.
- Parameters
-
- Return values
-
1 | - no patterns were matched (if delegated to decryption_okay_regex) |
0 | - DECRYPTION_OKAY was seen, with no PLAINTEXT outside |
-1 | - No decryption status codes were encountered |
-2 | - PLAINTEXT was encountered outside of DECRYPTION delimiters |
-3 | - DECRYPTION_FAILED was encountered |
Checks GnuPGP status fd output for various status codes indicating an issue. If $pgp_check_gpg_decrypt_status_fd is unset, it falls back to the old behavior of just scanning for $pgp_decryption_okay.
pgp_decrypt_part() should fail if the part is not encrypted, so we return less than 0 to indicate part or all was NOT actually encrypted.
On the other hand, for pgp_application_pgp_handler(), a "BEGIN PGP MESSAGE" could indicate a signed and armored message. For that we allow -1 and -2 as "valid" (with a warning).
Definition at line 350 of file pgp.c.
353 char *line = NULL, *s = NULL;
355 int inside_decrypt = 0;
358 if (!c_pgp_check_gpg_decrypt_status_fd)
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
static int pgp_check_pgp_decryption_okay_regex(FILE *fp_in)
Check PGP output to look for successful outcome.
static size_t plen
Length of cached packet.
static void pgp_copy_clearsigned |
( |
FILE * |
fp_in, |
|
|
struct State * |
s, |
|
|
char * |
charset |
|
) |
| |
|
static |
Copy a clearsigned message, stripping the signature.
- Parameters
-
fp_in | File to read from |
s | State to use |
charset | Charset of file |
XXX charset handling: We assume that it is safe to do character set decoding first, dash decoding second here, while we do it the other way around in the main handler.
(Note that we aren't worse than Outlook &c in this, and also note that we can successfully handle anything produced by any existing versions of neomutt.)
Definition at line 413 of file pgp.c.
416 bool complete, armor_header;
426 for (complete =
true, armor_header =
true;
443 armor_header =
false;
450 if ((buf[0] ==
'-') && (buf[1] ==
' '))
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
void mutt_ch_fgetconv_close(struct FgetConv **fc)
Close an fgetconv handle.
struct FgetConv * mutt_ch_fgetconv_open(FILE *fp, const char *from, const char *to, uint8_t flags)
Prepare a file for charset conversion.
char * mutt_ch_fgetconvs(char *buf, size_t buflen, struct FgetConv *fc)
Convert a file's charset into a string buffer.
#define MUTT_ICONV_HOOK_FROM
apply charset-hooks to fromcode
#define state_puts(STATE, STR)
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
char * mutt_str_skip_whitespace(const char *p)
Find the first non-whitespace character in a string.
Cursor for converting a file's encoding.
char * prefix
String to add to the beginning of each output line.