NeoMutt  2024-11-14-138-ge5ca67
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
smime.h File Reference

SMIME helper routines. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "lib.h"
+ Include dependency graph for smime.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SmimeKey
 An SIME key. More...
 
struct  SmimeCommandContext
 Data for a SIME command. More...
 

Enumerations

enum  ExpandoDataSmimeCmd {
  ED_SMI_ALGORITHM = 1 , ED_SMI_CERTIFICATE_IDS , ED_SMI_CERTIFICATE_PATH , ED_SMI_DIGEST_ALGORITHM ,
  ED_SMI_INTERMEDIATE_IDS , ED_SMI_KEY , ED_SMI_MESSAGE_FILE , ED_SMI_SIGNATURE_FILE
}
 Expando UIDs for Smime Commands. More...
 

Functions

 ARRAY_HEAD (SmimeKeyArray, struct SmimeKey *)
 
void smime_init (void)
 Initialise smime globals.
 
void smime_cleanup (void)
 Clean up smime globals.
 
int smime_class_application_handler (struct Body *b, struct State *s)
 Manage the MIME type "application/pgp" or "application/smime" - Implements CryptModuleSpecs::application_handler() -.
 
struct Bodysmime_class_build_smime_entity (struct Body *b, char *certlist)
 Encrypt the email body to all recipients - Implements CryptModuleSpecs::smime_build_smime_entity() -.
 
int smime_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
 Decrypt an encrypted MIME part - Implements CryptModuleSpecs::decrypt_mime() -.
 
char * smime_class_find_keys (const struct AddressList *addrlist, bool oppenc_mode)
 Find the keyids of the recipients of a message - Implements CryptModuleSpecs::find_keys() -.
 
void smime_class_getkeys (struct Envelope *env)
 Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.
 
void smime_class_invoke_import (const char *infile, const char *mailbox)
 Add a certificate and update index file (externally) - Implements CryptModuleSpecs::smime_invoke_import() -.
 
SecurityFlags smime_class_send_menu (struct Email *e)
 Ask the user whether to sign and/or encrypt the email - Implements CryptModuleSpecs::send_menu() -.
 
struct Bodysmime_class_sign_message (struct Body *b, const struct AddressList *from)
 Cryptographically sign the Body of a message - Implements CryptModuleSpecs::sign_message() -.
 
bool smime_class_valid_passphrase (void)
 Ensure we have a valid passphrase - Implements CryptModuleSpecs::valid_passphrase() -.
 
int smime_class_verify_one (struct Body *b, struct State *s, const char *tempfile)
 Check a signed MIME part against a signature - Implements CryptModuleSpecs::verify_one() -.
 
int smime_class_verify_sender (struct Email *e, struct Message *msg)
 Does the sender match the certificate? - Implements CryptModuleSpecs::smime_verify_sender() -.
 
void smime_class_void_passphrase (void)
 Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
 

Detailed Description

SMIME helper routines.

Authors
  • Richard Russon
  • Pietro Cerutti

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 smime.h.

Enumeration Type Documentation

◆ ExpandoDataSmimeCmd

Expando UIDs for Smime Commands.

See also
ED_SMIME_CMD, ExpandoDomain
Enumerator
ED_SMI_ALGORITHM 

SmimeCommandContext.cryptalg.

ED_SMI_CERTIFICATE_IDS 

SmimeCommandContext.certificates.

ED_SMI_CERTIFICATE_PATH 

Path of Smime certificates.

ED_SMI_DIGEST_ALGORITHM 

SmimeCommandContext.digestalg.

ED_SMI_INTERMEDIATE_IDS 

SmimeCommandContext.intermediates.

ED_SMI_KEY 

SmimeCommandContext.key.

ED_SMI_MESSAGE_FILE 

SmimeCommandContext.fname.

ED_SMI_SIGNATURE_FILE 

SmimeCommandContext.sig_fname.

Definition at line 73 of file smime.h.

74{
83};
@ ED_SMI_MESSAGE_FILE
SmimeCommandContext.fname.
Definition: smime.h:81
@ ED_SMI_ALGORITHM
SmimeCommandContext.cryptalg.
Definition: smime.h:75
@ ED_SMI_SIGNATURE_FILE
SmimeCommandContext.sig_fname.
Definition: smime.h:82
@ ED_SMI_DIGEST_ALGORITHM
SmimeCommandContext.digestalg.
Definition: smime.h:78
@ ED_SMI_CERTIFICATE_IDS
SmimeCommandContext.certificates.
Definition: smime.h:76
@ ED_SMI_KEY
SmimeCommandContext.key.
Definition: smime.h:80
@ ED_SMI_INTERMEDIATE_IDS
SmimeCommandContext.intermediates.
Definition: smime.h:79
@ ED_SMI_CERTIFICATE_PATH
Path of Smime certificates.
Definition: smime.h:77

Function Documentation

◆ ARRAY_HEAD()

ARRAY_HEAD ( SmimeKeyArray  ,
struct SmimeKey  
)

◆ smime_init()

void smime_init ( void  )

Initialise smime globals.

Definition at line 82 of file smime.c.

83{
87}
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition: buffer.c:337
static struct Buffer SmimeIntermediateToUse
Smime intermediate certificate to use.
Definition: smime.c:77
static struct Buffer SmimeKeyToUse
Smime key to use.
Definition: smime.c:73
static struct Buffer SmimeCertToUse
Smime certificate to use.
Definition: smime.c:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ smime_cleanup()

void smime_cleanup ( void  )

Clean up smime globals.

Definition at line 92 of file smime.c.

93{
97}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:377
+ Here is the call graph for this function:
+ Here is the caller graph for this function: