Decrypt an encrypted MIME part.
More...
|
int | pgp_gpgme_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur) |
| Implements CryptModuleSpecs::decrypt_mime() -. More...
|
|
int | smime_gpgme_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur) |
| Implements CryptModuleSpecs::decrypt_mime() -. More...
|
|
int | pgp_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur) |
| Implements CryptModuleSpecs::decrypt_mime() -. More...
|
|
int | smime_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur) |
| Implements CryptModuleSpecs::decrypt_mime() -. More...
|
|
Decrypt an encrypted MIME part.
- Parameters
-
[in] | fp_in | File containing the encrypted part |
[out] | fp_out | File containing the decrypted part |
[in] | b | Body of the email |
[out] | cur | Body containing the decrypted part |
- Return values
-
◆ pgp_gpgme_decrypt_mime()
int pgp_gpgme_decrypt_mime |
( |
FILE * |
fp_in, |
|
|
FILE ** |
fp_out, |
|
|
struct Body * |
b, |
|
|
struct Body ** |
cur |
|
) |
| |
Implements CryptModuleSpecs::decrypt_mime() -.
Definition at line 2210 of file crypt_gpgme.c.
2212 struct State s = { 0 };
2213 struct Body *first_part = b;
2215 bool need_decode =
false;
2216 LOFF_T saved_offset = 0;
2217 size_t saved_length = 0;
2218 FILE *fp_decoded = NULL;
2243 saved_offset = b->
offset;
2244 saved_length = b->
length;
2263 b->
length = ftello(fp_decoded);
2266 s.
fp_in = fp_decoded;
2278 *cur =
decrypt_part(b, &s, *fp_out,
false, &is_signed);
2294 b->
length = saved_length;
2295 b->
offset = saved_offset;
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
Is this a valid multi-part encrypted message?
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
static struct Body * decrypt_part(struct Body *a, struct State *s, FILE *fp_out, bool is_smime, int *r_is_signed)
Decrypt a PGP or SMIME message.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
bool mutt_file_seek(FILE *fp, LOFF_T offset, int whence)
Wrapper for fseeko with error handling.
#define mutt_file_mkstemp()
void mutt_decode_attachment(struct Body *b, struct State *s)
Decode an email's attachment.
struct Body * parts
parts of a multipart or message/rfc822
LOFF_T offset
offset where the actual data begins
LOFF_T length
length (in bytes) of attachment
struct Body * next
next attachment in the list
unsigned int encoding
content-transfer-encoding, ContentEncoding
bool goodsig
Good cryptographic signature.
bool warnsig
Maybe good signature.
Keep track when processing files.
FILE * fp_out
File to write to.
FILE * fp_in
File to read from.
◆ smime_gpgme_decrypt_mime()
int smime_gpgme_decrypt_mime |
( |
FILE * |
fp_in, |
|
|
FILE ** |
fp_out, |
|
|
struct Body * |
b, |
|
|
struct Body ** |
cur |
|
) |
| |
Implements CryptModuleSpecs::decrypt_mime() -.
Definition at line 2305 of file crypt_gpgme.c.
2307 struct State s = { 0 };
2309 LOFF_T saved_b_offset;
2310 size_t saved_b_length;
2322 saved_b_offset = b->
offset;
2323 saved_b_length = b->
length;
2343 memset(&s, 0,
sizeof(s));
2355 (*cur)->goodsig = is_signed > 0;
2356 b->
length = saved_b_length;
2357 b->
offset = saved_b_offset;
2369 struct Body *bb = *cur;
2371 saved_b_offset = bb->
offset;
2372 saved_b_length = bb->
length;
2373 memset(&s, 0,
sizeof(s));
2394 memset(&s, 0,
sizeof(s));
2406 b_tmp->
goodsig = is_signed > 0;
2407 bb->
length = saved_b_length;
2408 bb->
offset = saved_b_offset;
2414 return *cur ? 0 : -1;
SecurityFlags mutt_is_application_smime(struct Body *b)
Does the message use S/MIME?
void mutt_body_free(struct Body **ptr)
Free a Body.
#define SEC_NO_FLAGS
No flags are set.
◆ pgp_class_decrypt_mime()
int pgp_class_decrypt_mime |
( |
FILE * |
fp_in, |
|
|
FILE ** |
fp_out, |
|
|
struct Body * |
b, |
|
|
struct Body ** |
cur |
|
) |
| |
Implements CryptModuleSpecs::decrypt_mime() -.
Definition at line 1141 of file pgp.c.
1143 struct State s = { 0 };
1145 bool need_decode =
false;
1146 LOFF_T saved_offset = 0;
1147 size_t saved_length = 0;
1148 FILE *fp_decoded = NULL;
1170 saved_offset = b->
offset;
1171 saved_length = b->
length;
1190 b->
length = ftello(fp_decoded);
1193 s.
fp_in = fp_decoded;
1213 b->
length = saved_length;
1214 b->
offset = saved_offset;
static struct Body * pgp_decrypt_part(struct Body *a, struct State *s, FILE *fp_out, struct Body *p)
Decrypt part of a PGP message.
◆ smime_class_decrypt_mime()
int smime_class_decrypt_mime |
( |
FILE * |
fp_in, |
|
|
FILE ** |
fp_out, |
|
|
struct Body * |
b, |
|
|
struct Body ** |
cur |
|
) |
| |
Implements CryptModuleSpecs::decrypt_mime() -.
Definition at line 2072 of file smime.c.
2074 struct State s = { 0 };
2075 LOFF_T tmpoffset = b->
offset;
2076 size_t tmplength = b->
length;
2119 (*cur)->badsig = b->
badsig;
static struct Body * smime_handle_entity(struct Body *m, struct State *s, FILE *fp_out_file)
Handle type application/pkcs7-mime.
bool badsig
Bad cryptographic signature (needed to check encrypted s/mime-signatures)