Changeset 3663:e5ec22eb5a6d
- Timestamp:
- 2004-06-17 13:36:13 (5 years ago)
- Branch:
- HEAD
- Files:
-
- 4 added
- 17 modified
-
Makefile.am (modified) (3 diffs)
-
compose.c (modified) (4 diffs)
-
configure.in (modified) (2 diffs)
-
crypt-mod-pgp-classic.c (added)
-
crypt-mod-smime-classic.c (added)
-
crypt-mod.c (added)
-
crypt-mod.h (added)
-
crypt.c (modified) (4 diffs)
-
cryptglue.c (modified) (22 diffs)
-
curs_lib.c (modified) (2 diffs)
-
init.h (modified) (2 diffs)
-
keymap.c (modified) (3 diffs)
-
keymap.h (modified) (1 diff)
-
main.c (modified) (2 diffs)
-
mutt.h (modified) (3 diffs)
-
mutt_crypt.h (modified) (8 diffs)
-
mutt_curses.h (modified) (2 diffs)
-
pgp.c (modified) (5 diffs)
-
pgp.h (modified) (4 diffs)
-
smime.c (modified) (4 diffs)
-
smime.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Makefile.am
r3511 r3663 29 29 status.c system.c thread.c charset.c history.c lib.c \ 30 30 muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c \ 31 url.c ascii.c mutt_idna.c 31 url.c ascii.c mutt_idna.c crypt-mod.c crypt-mod.h 32 32 33 33 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \ 34 $(INTLLIBS) $(LIBICONV) 34 $(INTLLIBS) $(LIBICONV) 35 35 36 36 mutt_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAPDEPS) \ … … 56 56 INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) -Iintl 57 57 58 CPPFLAGS=@CPPFLAGS@ -I$(includedir) 58 CPPFLAGS=@CPPFLAGS@ -I$(includedir) -D_FILE_OFFSET_BITS=64 59 59 60 60 … … 63 63 pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \ 64 64 browser.h mbyte.h remailer.h url.h mutt_ssl_nss.c \ 65 crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \ 65 66 pgppacket.c mutt_idna.h 66 67 -
compose.c
r3652 r3663 1 1 /* 2 2 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org> 3 * Copyright (C) 2004 g10 Code GmbH 3 4 * 4 5 * This program is free software; you can redistribute it and/or modify … … 160 161 off = 20; 161 162 } 162 }163 164 165 166 static int pgp_send_menu (HEADER *msg, int *redraw)167 {168 pgp_key_t p;169 char input_signas[SHORT_STRING];170 171 if (!(WithCrypto & APPLICATION_PGP))172 return msg->security;173 174 switch (mutt_multi_choice (_("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, (i)nline, or (f)orget it? "),175 _("esabif")))176 {177 case 1: /* (e)ncrypt */178 msg->security ^= ENCRYPT;179 break;180 181 case 2: /* (s)ign */182 msg->security ^= SIGN;183 break;184 185 case 3: /* sign (a)s */186 unset_option(OPTPGPCHECKTRUST);187 188 if ((p = crypt_pgp_ask_for_key (_("Sign as: "), NULL,189 KEYFLAG_CANSIGN, PGP_PUBRING)))190 {191 snprintf (input_signas, sizeof (input_signas), "0x%s",192 crypt_pgp_keyid (p));193 mutt_str_replace (&PgpSignAs, input_signas);194 crypt_pgp_free_key (&p);195 196 msg->security |= SIGN;197 198 crypt_pgp_void_passphrase (); /* probably need a different passphrase */199 }200 else201 {202 msg->security &= ~SIGN;203 }204 205 *redraw = REDRAW_FULL;206 break;207 208 case 4: /* (b)oth */209 if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))210 msg->security = 0;211 else212 msg->security |= (ENCRYPT | SIGN);213 break;214 215 case 5: /* (i)nline */216 if ((msg->security & (ENCRYPT | SIGN)))217 msg->security ^= INLINE;218 else219 msg->security &= ~INLINE;220 break;221 222 case 6: /* (f)orget it */223 msg->security = 0;224 break;225 }226 227 if (msg->security)228 {229 if (! (msg->security & (ENCRYPT | SIGN)))230 msg->security = 0;231 else232 msg->security |= APPLICATION_PGP;233 }234 235 if(*redraw)236 redraw_crypt_lines (msg);237 return (msg->security);238 }239 240 241 242 static int smime_send_menu (HEADER *msg, int *redraw)243 {244 char *p;245 246 if (!(WithCrypto & APPLICATION_SMIME))247 return msg->security;248 249 switch (mutt_multi_choice (_("S/MIME (e)ncrypt, (s)ign, encrypt (w)ith, sign (a)s, (b)oth, or (f)orget it? "),250 _("eswabf")))251 {252 case 1: /* (e)ncrypt */253 msg->security |= ENCRYPT;254 break;255 256 case 3: /* encrypt (w)ith */257 msg->security |= ENCRYPT;258 switch (mutt_multi_choice (_("1: DES, 2: Triple-DES, 3: RC2-40,"259 " 4: RC2-64, 5: RC2-128, or (f)orget it? "),260 _("12345f"))) {261 case 1:262 mutt_str_replace (&SmimeCryptAlg, "des");263 break;264 case 2:265 mutt_str_replace (&SmimeCryptAlg, "des3");266 break;267 case 3:268 mutt_str_replace (&SmimeCryptAlg, "rc2-40");269 break;270 case 4:271 mutt_str_replace (&SmimeCryptAlg, "rc2-64");272 break;273 case 5:274 mutt_str_replace (&SmimeCryptAlg, "rc2-128");275 break;276 case 6: /* forget it */277 break;278 }279 break;280 281 case 2: /* (s)ign */282 283 if(!SmimeDefaultKey)284 mutt_message("Can\'t sign: No key specified. use sign(as).");285 else286 msg->security |= SIGN;287 break;288 289 case 4: /* sign (a)s */290 291 if ((p = crypt_smime_ask_for_key (_("Sign as: "), NULL, 0))) {292 p[mutt_strlen (p)-1] = '\0';293 mutt_str_replace (&SmimeDefaultKey, p);294 295 msg->security |= SIGN;296 297 /* probably need a different passphrase */298 crypt_smime_void_passphrase ();299 }300 else301 msg->security &= ~SIGN;302 303 *redraw = REDRAW_FULL;304 break;305 306 case 5: /* (b)oth */307 msg->security = ENCRYPT | SIGN;308 break;309 310 case 6: /* (f)orget it */311 msg->security = 0;312 break;313 }314 315 if (msg->security && msg->security != APPLICATION_SMIME)316 msg->security |= APPLICATION_SMIME;317 else318 msg->security = 0;319 320 if(*redraw)321 redraw_crypt_lines (msg);322 return (msg->security);323 163 } 324 164 … … 1345 1185 msg->security = 0; 1346 1186 } 1347 msg->security = pgp_send_menu (msg, &menu->redraw);1187 msg->security = crypt_pgp_send_menu (msg, &menu->redraw); 1348 1188 redraw_crypt_lines (msg); 1349 1189 break; … … 1370 1210 msg->security = 0; 1371 1211 } 1372 msg->security = smime_send_menu(msg, &menu->redraw);1212 msg->security = crypt_smime_send_menu(msg, &menu->redraw); 1373 1213 redraw_crypt_lines (msg); 1374 1214 break; -
configure.in
r3528 r3663 106 106 [ Define if you want classic PGP support. ]) 107 107 PGPAUX_TARGET="pgpring pgpewrap" 108 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o "108 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o crypt-mod-pgp-classic.o" 109 109 fi 110 110 … … 118 118 AC_DEFINE(CRYPT_BACKEND_CLASSIC_SMIME,1, 119 119 [ Define if you want clasic S/MIME support. ]) 120 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smime.o "120 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smime.o crypt-mod-smime-classic.o" 121 121 SMIMEAUX_TARGET="smime_keys" 122 122 fi -
crypt.c
r3656 r3663 5 5 * Oliver Ehli <elmy@acm.org> 6 6 * Copyright (C) 2003 Werner Koch <wk@gnupg.org> 7 * Copyright (C) 2004 g10code GmbH 7 8 * 8 9 * This program is free software; you can redistribute it and/or modify … … 108 109 { 109 110 time_t now = time (NULL); 111 int ret = 0; 110 112 111 113 # if defined(HAVE_SETRLIMIT) &&(!defined(DEBUG)) … … 114 116 115 117 if ((WithCrypto & APPLICATION_PGP) && (flags & APPLICATION_PGP)) 116 { 117 extern char PgpPass[STRING]; 118 extern time_t PgpExptime; 119 120 if (pgp_use_gpg_agent()) 121 { 122 *PgpPass = 0; 123 return 1; /* handled by gpg-agent */ 124 } 125 126 if (now < PgpExptime) return 1; /* just use the cached copy. */ 127 crypt_pgp_void_passphrase (); 128 129 if (mutt_get_password (_("Enter PGP passphrase:"), 130 PgpPass, sizeof (PgpPass)) == 0) 131 { 132 PgpExptime = time (NULL) + PgpTimeout; 133 return (1); 134 } 135 else 136 PgpExptime = 0; 137 } 118 ret = crypt_pgp_valid_passphrase (); 138 119 139 120 if ((WithCrypto & APPLICATION_SMIME) && (flags & APPLICATION_SMIME)) 140 { 141 extern char SmimePass[STRING]; 142 extern time_t SmimeExptime; 143 144 if (now < SmimeExptime) return (1); 145 crypt_smime_void_passphrase (); 146 147 if (mutt_get_password (_("Enter SMIME passphrase:"), SmimePass, 148 sizeof (SmimePass)) == 0) 149 { 150 SmimeExptime = time (NULL) + SmimeTimeout; 151 return (1); 152 } 153 else 154 SmimeExptime = 0; 155 } 156 157 return (0); 121 ret = crypt_smime_valid_passphrase (); 122 123 return ret; 158 124 } 159 125 … … 276 242 /* destroy temporary signature envelope when doing retainable 277 243 * signatures. 244 278 245 */ 279 246 if (flags != msg->security) -
cryptglue.c
r3271 r3663 1 1 /* 2 2 * Copyright (C) 2003 Werner Koch <wk@gnupg.org> 3 * Copyright (C) 2004 g10 Code GmbH 3 4 * 4 5 * This program is free software; you can redistribute it and/or modify … … 18 19 19 20 /* 20 This file dispatches the generic cry tpo functions to the implemented21 backend or provides dummy stubs. Note, that some generic functions are22 handled in crypt.c.21 This file dispatches the generic crypto functions to the 22 implemented backend or provides dummy stubs. Note, that some 23 generic functions are handled in crypt.c. 23 24 */ 25 26 /* Note: This file has been changed to make use of the new module 27 system. Consequently there's a 1:1 mapping between the functions 28 contained in this file and the functions implemented by the crypto 29 modules. */ 24 30 25 31 #include "mutt.h" 26 32 #include "mutt_crypt.h" 27 33 28 /* Make sure those macros are not defined. */ 29 #undef BFNC_PGP_VOID_PASSPHRASE 30 #undef BFNC_PGP_DECRYPT_MIME 31 #undef BFNC_PGP_APPLICATION_PGP_HANDLER 32 #undef BFNC_PGP_ENCRYPTED_HANDLER 33 #undef BFNC_PGP_INVOKE_GETKEYS 34 #undef BFNC_PGP_ASK_FOR_KEY 35 #undef BNFC_PGP_CHECK_TRADITIONAL 36 #undef BFNC_PGP_TRADITIONAL_ENCRYPTSIGN 37 #undef BFNC_PGP_FREE_KEY 38 #undef BFNC_PGP_MAKE_KEY_ATTACHMENT 39 #undef BFNC_PGP_FINDKEYS 40 #undef BFNC_PGP_SIGN_MESSAGE 41 #undef BFNC_PGP_ENCRYPT_MESSAGE 42 #undef BFNC_PGP_INVOKE_IMPORT 43 #undef BFNC_PGP_VERIFY_ONE 44 #undef BFNC_PGP_KEYID 45 #undef BFNC_PGP_EXTRACT_KEYS_FROM_ATTACHMENT_LIST 46 47 #undef BFNC_SMIME_VOID_PASSPHRASE 48 #undef BFNC_SMIME_DECRYPT_MIME 49 #undef BFNC_SMIME_APPLICATION_SMIME_HANDLER 50 #undef BFNC_SMIME_GETKEYS 51 #undef BFNC_SMIME_VERIFY_SENDER 52 #undef BFNC_SMIME_ASK_FOR_KEY 53 #undef BFNC_SMIME_FINDKEYS 54 #undef BFNC_SMIME_SIGN_MESSAGE 55 #undef BFNC_SMIME_BUILD_SMIME_ENTITY 56 #undef BFNC_SMIME_INVOKE_IMPORT 57 #undef BFNC_SMIME_VERIFY_ONE 58 59 60 /* The PGP backend */ 61 #if defined (CRYPT_BACKEND_CLASSIC_PGP) 62 # include "pgp.h" 63 # define BFNC_PGP_VOID_PASSPHRASE pgp_void_passphrase 64 # define BFNC_PGP_DECRYPT_MIME pgp_decrypt_mime 65 # define BFNC_PGP_APPLICATION_PGP_HANDLER pgp_application_pgp_handler 66 # define BFNC_PGP_ENCRYPTED_HANDLER pgp_encrypted_handler 67 # define BFNC_PGP_INVOKE_GETKEYS pgp_invoke_getkeys 68 # define BFNC_PGP_ASK_FOR_KEY pgp_ask_for_key 69 # define BNFC_PGP_CHECK_TRADITIONAL pgp_check_traditional 70 # define BFNC_PGP_TRADITIONAL_ENCRYPTSIGN pgp_traditional_encryptsign 71 # define BFNC_PGP_FREE_KEY pgp_free_key 72 # define BFNC_PGP_MAKE_KEY_ATTACHMENT pgp_make_key_attachment 73 # define BFNC_PGP_FINDKEYS pgp_findKeys 74 # define BFNC_PGP_SIGN_MESSAGE pgp_sign_message 75 # define BFNC_PGP_ENCRYPT_MESSAGE pgp_encrypt_message 76 # define BFNC_PGP_INVOKE_IMPORT pgp_invoke_import 77 # define BFNC_PGP_VERIFY_ONE pgp_verify_one 78 # define BFNC_PGP_KEYID pgp_keyid 79 # define BFNC_PGP_EXTRACT_KEYS_FROM_ATTACHMENT_LIST \ 80 pgp_extract_keys_from_attachment_list 81 82 83 #elif defined (CRYPT_BACKEND_GPGME) 84 # include "crypt-gpgme.h" 85 # define BFNC_PGP_VOID_PASSPHRASE NULL /* not required */ 86 # define BFNC_PGP_DECRYPT_MIME gpg_pgp_decrypt_mime 87 88 #endif /* PGP backend */ 89 90 91 /* The SMIME backend */ 92 #ifdef CRYPT_BACKEND_CLASSIC_SMIME 93 # include "smime.h" 94 # define BFNC_SMIME_VOID_PASSPHRASE smime_void_passphrase 95 # define BFNC_SMIME_DECRYPT_MIME smime_decrypt_mime 96 # define BFNC_SMIME_APPLICATION_SMIME_HANDLER smime_application_smime_handler 97 # define BFNC_SMIME_GETKEYS smime_getkeys 98 # define BFNC_SMIME_VERIFY_SENDER smime_verify_sender 99 # define BFNC_SMIME_ASK_FOR_KEY smime_ask_for_key 100 # define BFNC_SMIME_FINDKEYS smime_findKeys 101 # define BFNC_SMIME_SIGN_MESSAGE smime_sign_message 102 # define BFNC_SMIME_BUILD_SMIME_ENTITY smime_build_smime_entity 103 # define BFNC_SMIME_INVOKE_IMPORT smime_invoke_import 104 # define BFNC_SMIME_VERIFY_ONE smime_verify_one 105 106 #elif defined (CRYPT_BACKEND_GPGME) 107 /* Already included above (gpgme supports both). */ 108 # define BFNC_SMIME_VOID_PASSPHRASE NULL /* not required */ 109 110 #endif /* SMIME backend */ 111 112 34 #include "crypt-mod.h" 35 113 36 /* 114 37 … … 117 40 */ 118 41 42 #ifdef CRYPT_BACKEND_CLASSIC_PGP 43 extern struct crypt_module_specs crypt_mod_pgp_classic; 44 #endif 45 46 #ifdef CRYPT_BACKEND_CLASSIC_SMIME 47 extern struct crypt_module_specs crypt_mod_smime_classic; 48 #endif 49 50 #ifdef CRYPT_BACKEND_GPGME 51 extern struct crypt_module_specs crypt_mod_pgp_gpgme; 52 extern struct crypt_module_specs crypt_mod_smime_gpgme; 53 #endif 54 55 void crypt_init (void) 56 { 57 #ifdef CRYPT_BACKEND_CLASSIC_PGP 58 if ( 59 #ifdef CRYPT_BACKEND_GPGME 60 (! option (OPTCRYPTUSEGPGME)) 61 #else 62 1 63 #endif 64 ) 65 crypto_module_register (&crypt_mod_pgp_classic); 66 #endif 67 68 #ifdef CRYPT_BACKEND_CLASSIC_SMIME 69 if ( 70 #ifdef CRYPT_BACKEND_GPGME 71 (! option (OPTCRYPTUSEGPGME)) 72 #else 73 1 74 #endif 75 ) 76 crypto_module_register (&crypt_mod_smime_classic); 77 #endif 78 79 if (option (OPTCRYPTUSEGPGME)) 80 { 81 #ifdef CRYPT_BACKEND_GPGME 82 crypto_module_register (&crypt_mod_pgp_gpgme); 83 crypto_module_register (&crypt_mod_smime_gpgme); 84 #else 85 mutt_message (_("\"crypt_use_gpgme\" set" 86 " but not build with GPGME support.")); 87 #endif 88 } 89 90 #if defined CRYPT_BACKEND_CLASSIG_PGP || defined CRYPT_BACKEND_CLASSIG_SMIME || defined CRYPT_BACKEND_GPGME 91 if (CRYPT_MOD_CALL_CHECK (PGP, init)) 92 (CRYPT_MOD_CALL (PGP, init)) (); 93 94 if (CRYPT_MOD_CALL_CHECK (SMIME, init)) 95 (CRYPT_MOD_CALL (SMIME, init)) (); 96 #endif 97 } 98 99 119 100 /* Show a message that a backend will be invoked. */ 120 101 void crypt_invoke_message (int type) 121 102 { 122 #if defined (CRYPT_BACKEND_CLASSIC_PGP) || defined(CRYPT_BACKEND_CLASSIC_SMIME) 123 if ((type & APPLICATION_PGP)) 103 if ((WithCrypto & APPLICATION_PGP) && (type & APPLICATION_PGP)) 124 104 mutt_message _("Invoking PGP..."); 125 if ((type & APPLICATION_SMIME)) 126 mutt_message _("Invoking OpenSSL..."); 127 #elif defined (CRYPT_BACKEND_GPGME) 128 if ((type & APPLICATION_PGP) || (type & APPLICATION_SMIME) ) 129 mutt_message _("Invoking GnuPG..."); 130 #endif 105 else if ((WithCrypto & APPLICATION_SMIME) && (type & APPLICATION_SMIME)) 106 mutt_message _("Invoking SMIME..."); 131 107 } 132 108 … … 143 119 void crypt_pgp_void_passphrase (void) 144 120 { 145 #ifdef BFNC_PGP_VOID_PASSPHRASE 146 BFNC_PGP_VOID_PASSPHRASE (); 147 #endif 148 } 121 if (CRYPT_MOD_CALL_CHECK (PGP, void_passphrase)) 122 (CRYPT_MOD_CALL (PGP, void_passphrase)) (); 123 } 124 125 int crypt_pgp_valid_passphrase (void) 126 { 127 if (CRYPT_MOD_CALL_CHECK (PGP, valid_passphrase)) 128 return (CRYPT_MOD_CALL (PGP, valid_passphrase)) (); 129 130 return 0; 131 } 132 149 133 150 134 /* Decrypt a PGP/MIME message. */ 151 135 int crypt_pgp_decrypt_mime (FILE *a, FILE **b, BODY *c, BODY **d) 152 136 { 153 #ifdef BFNC_PGP_DECRYPT_MIME 154 return BFNC_PGP_DECRYPT_MIME (a, b, c, d); 155 #else 156 return -1; /* error */ 157 #endif 137 if (CRYPT_MOD_CALL_CHECK (PGP, decrypt_mime)) 138 return (CRYPT_MOD_CALL (PGP, decrypt_mime)) (a, b, c, d); 139 140 return -1; 158 141 } 159 142 … … 161 144 void crypt_pgp_application_pgp_handler (BODY *m, STATE *s) 162 145 { 163 #ifdef BFNC_PGP_APPLICATION_PGP_HANDLER 164 BFNC_PGP_APPLICATION_PGP_HANDLER (m, s); 165 #endif 146 if (CRYPT_MOD_CALL_CHECK (PGP, application_handler)) 147 (CRYPT_MOD_CALL (PGP, application_handler)) (m, s); 166 148 } 167 149 … … 169 151 void crypt_pgp_encrypted_handler (BODY *a, STATE *s) 170 152 { 171 #ifdef BFNC_PGP_ENCRYPTED_HANDLER 172 BFNC_PGP_ENCRYPTED_HANDLER (a, s); 173 #endif 153 if (CRYPT_MOD_CALL_CHECK (PGP, encrypted_handler)) 154 (CRYPT_MOD_CALL (PGP, encrypted_handler)) (a, s); 174 155 } 175 156 … … 177 158 void crypt_pgp_invoke_getkeys (ADDRESS *addr) 178 159 { 179 #ifdef BFNC_PGP_INVOKE_GETKEYS 180 BFNC_PGP_INVOKE_GETKEYS (addr); 181 #endif 182 } 183 184 /* Ask for a PGP key. */ 185 pgp_key_t crypt_pgp_ask_for_key (char *tag, char *whatfor, 186 short abilities, pgp_ring_t keyring) 187 { 188 #ifdef BFNC_PGP_ASK_FOR_KEY 189 return BFNC_PGP_ASK_FOR_KEY (tag, whatfor, abilities, keyring); 190 #else 191 return NULL; 192 #endif 193 } 194 160 if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_getkeys)) 161 (CRYPT_MOD_CALL (PGP, pgp_invoke_getkeys)) (addr); 162 } 195 163 196 164 /* Check for a traditional PGP message in body B. */ 197 165 int crypt_pgp_check_traditional (FILE *fp, BODY *b, int tagged_only) 198 166 { 199 #ifdef BNFC_PGP_CHECK_TRADITIONAL 200 return BNFC_PGP_CHECK_TRADITIONAL (fp, b, tagged_only); 201 #else 202 return 0; /* no */ 203 #endif 167 if (CRYPT_MOD_CALL_CHECK (PGP, pgp_check_traditional)) 168 return (CRYPT_MOD_CALL (PGP, pgp_check_traditional)) (fp, b, tagged_only); 169 170 return 0; 204 171 } 205 172 … … 207 174 BODY *crypt_pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) 208 175 { 209 #ifdef BFNC_PGP_TRADITIONAL_ENCRYPTSIGN 210 return BFNC_PGP_TRADITIONAL_ENCRYPTSIGN (a, flags, keylist); 211 #else 212 return NULL; 213 #endif 214 } 215 216 /* Release pgp key KPP. */ 217 void crypt_pgp_free_key (pgp_key_t *kpp) 218 { 219 #ifdef BFNC_PGP_FREE_KEY 220 BFNC_PGP_FREE_KEY (kpp); 221 #endif 222 } 223 176 if (CRYPT_MOD_CALL_CHECK (PGP, pgp_traditional_encryptsign)) 177 return (CRYPT_MOD_CALL (PGP, pgp_traditional_encryptsign)) (a, flags, keylist); 178 179 return NULL; 180 } 224 181 225 182 /* Generate a PGP public key attachment. */ 226 183 BODY *crypt_pgp_make_key_attachment (char *tempf) 227 184 { 228 #ifdef BFNC_PGP_MAKE_KEY_ATTACHMENT 229 return BFNC_PGP_MAKE_KEY_ATTACHMENT (tempf); 230 #else 231 return NULL; /* error */ 232 #endif 185 if (CRYPT_MOD_CALL_CHECK (PGP, pgp_make_key_attachment)) 186 return (CRYPT_MOD_CALL (PGP, pgp_make_key_attachment)) (tempf); 187 188 return NULL; 233 189 } 234 190 … … 237 193 char *crypt_pgp_findkeys (ADDRESS *to, ADDRESS *cc, ADDRESS *bcc) 238 194 { 239 #ifdef BFNC_PGP_FINDKEYS 240 return BFNC_PGP_FINDKEYS (to, cc, bcc); 241 #else 242 return NULL; 243 #endif 195 if (CRYPT_MOD_CALL_CHECK (PGP, findkeys)) 196 return (CRYPT_MOD_CALL (PGP, findkeys)) (to, cc, bcc); 197 198 return NULL; 244 199 } 245 200 … … 247 202 BODY *crypt_pgp_sign_message (BODY *a) 248 203 { 249 #ifdef BFNC_PGP_SIGN_MESSAGE 250 return BFNC_PGP_SIGN_MESSAGE (a); 251 #else 252 return NULL; 253 #endif 204 if (CRYPT_MOD_CALL_CHECK (PGP, sign_message)) 205 return (CRYPT_MOD_CALL (PGP, sign_message)) (a); 206 207 return NULL; 254 208 } 255 209 … … 258 212 BODY *crypt_pgp_encrypt_message (BODY *a, char *keylist, int sign) 259 213 { 260 #ifdef BFNC_PGP_ENCRYPT_MESSAGE 261 return BFNC_PGP_ENCRYPT_MESSAGE (a, keylist, sign); 262 #else 263 return NULL; 264 #endif 214 if (CRYPT_MOD_CALL_CHECK (PGP, pgp_encrypt_message)) 215 return (CRYPT_MOD_CALL (PGP, pgp_encrypt_message)) (a, keylist, sign); 216 217 return NULL; 265 218 } 266 219 … … 268 221 void crypt_pgp_invoke_import (const char *fname) 269 222 { 270 #ifdef BFNC_PGP_INVOKE_IMPORT 271 BFNC_PGP_INVOKE_IMPORT (fname); 272 #endif 223 if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_import)) 224 (CRYPT_MOD_CALL (PGP, pgp_invoke_import)) (fname); 273 225 } 274 226 … … 276 228 int crypt_pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempf)
