-static struct crypt_module_specs crypt_mod_smime_gpgme = { APPLICATION_SMIME,
- {
- smime_gpgme_init,
- smime_gpgme_decrypt_mime,
- smime_gpgme_application_handler,
- NULL, /* encrypted_handler */
- smime_gpgme_findkeys,
- smime_gpgme_sign_message,
- smime_gpgme_verify_one,
- smime_gpgme_send_menu,
-
- NULL, /* pgp_encrypt_message */
- NULL, /* pgp_make_key_attachment */
- NULL, /* pgp_check_traditional */
- NULL, /* pgp_traditional_encryptsign */
- NULL, /* pgp_invoke_getkeys */
- NULL, /* pgp_invoke_import */
- NULL, /* pgp_extract_keys_from_attachment_list */
-
- NULL, /* smime_getkeys */
- smime_gpgme_verify_sender,
- smime_gpgme_build_smime_entity,
- NULL, /* smime_invoke_import */
- }
-};
-
-static struct crypt_module_specs crypt_mod_pgp_gpgme = { APPLICATION_PGP,
- {
- pgp_gpgme_init,
- pgp_gpgme_decrypt_mime,
- pgp_gpgme_application_handler,
- pgp_gpgme_encrypted_handler,
- pgp_gpgme_findkeys,
- pgp_gpgme_sign_message,
- pgp_gpgme_verify_one,
- pgp_gpgme_send_menu,
-
- /* PGP specific. */
- pgp_gpgme_encrypt_message,
- NULL, /* pgp_make_key_attachment, */
- pgp_gpgme_check_traditional,
- NULL, /* pgp_traditional_encryptsign */
- NULL, /* pgp_invoke_getkeys */
- pgp_gpgme_invoke_import, /* pgp_invoke_import */
- pgp_gpgme_from_attachment_list,
- /* pgp_extract_keys_from_attachment_list */
-
- NULL, /* smime_getkeys */
- NULL, /* smime_verify_sender */
- NULL, /* smime_build_smime_entity */
- NULL, /* smime_invoke_import */
- }
-};
-
-void crypt_init (void)
-{
- crypto_module_register (&crypt_mod_pgp_gpgme);
- crypto_module_register (&crypt_mod_smime_gpgme);
-
- (CRYPT_MOD_CALL(PGP, init))();
- (CRYPT_MOD_CALL (SMIME, init)) ();
-}
-
-/* Show a message that a backend will be invoked. */
-void crypt_invoke_message (int type)
-{
- if (type & APPLICATION_PGP) {
- mutt_message _("Invoking PGP...");
- }
- else if (type & APPLICATION_SMIME) {
- mutt_message _("Invoking S/MIME...");
- }
-}
-
-
-/*
-
- PGP
-
-*/
-
-
-/* Decrypt a PGP/MIME message. */
-int crypt_pgp_decrypt_mime (FILE * a, FILE ** b, BODY * c, BODY ** d)
-{
- if (CRYPT_MOD_CALL_CHECK (PGP, decrypt_mime))
- return (CRYPT_MOD_CALL (PGP, decrypt_mime)) (a, b, c, d);
-
- return -1;
-}
-
-/* MIME handler for the application/pgp content-type. */
-int crypt_pgp_application_pgp_handler (BODY * m, STATE * s)
-{
- if (CRYPT_MOD_CALL_CHECK (PGP, application_handler))
- return (CRYPT_MOD_CALL (PGP, application_handler)) (m, s);
- return (-1);
-}
-
-/* MIME handler for an PGP/MIME encrypted message. */
-int crypt_pgp_encrypted_handler (BODY * a, STATE * s)
-{
- if (CRYPT_MOD_CALL_CHECK (PGP, encrypted_handler))
- return (CRYPT_MOD_CALL (PGP, encrypted_handler)) (a, s);
- return (-1);
-}