aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-crypto.c26
2 files changed, 26 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index cb3301af21..62abf833ca 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-13 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * mail-crypto.c (mail_crypto_openpgp_encrypt): Added support for
+ encrypting via PGP 5.0
+
2000-08-13 Ettore Perazzoli <ettore@helixcode.com>
* mail-ops.c (cleanup_create_folder): Release the listener object
diff --git a/mail/mail-crypto.c b/mail/mail-crypto.c
index 1055bb4569..71a2573eeb 100644
--- a/mail/mail-crypto.c
+++ b/mail/mail-crypto.c
@@ -465,20 +465,36 @@ mail_crypto_openpgp_encrypt (const char *plaintext,
sprintf (passwd_fd, "%d", passwd_fds[0]);
argv[i++] = passwd_fd;
}
-#elif defined(PGP5_PATH) /* FIXME: from here down needs to be modified to work correctly */
+#elif defined(PGP5_PATH)
path = PGP5_PATH;
+ recipient_list = g_ptr_array_new ();
+ for (r = 0; r < recipients->len; r++) {
+ char *buf, *recipient;
+
+ recipient = recipients->pdata[i];
+ buf = g_strdup_printf ("-r %s", recipient);
+ g_ptr_array_add (recipient_list, buf);
+ }
+
argv[i++] = "pgpe";
+
+ for (r = 0; r < recipient_list->len; r++)
+ argv[i++] = recipient_list->pdata[r];
+
argv[i++] = "-f";
argv[i++] = "-z";
argv[i++] = "-a";
+ argv[i++] = "-o";
+ argv[i++] = "-"; /* output to stdout */
- if (sign)
+ if (sign) {
argv[i++] = "-s";
- sprintf (passwd_fd, "PGPPASSFD=%d", passwd_fds[0]);
- putenv (passwd_fd);
-#else
+ sprintf (passwd_fd, "PGPPASSFD=%d", passwd_fds[0]);
+ putenv (passwd_fd);
+ }
+#else /* We still gotta get pgp 2.6.3 workin here ;-) */
path = PGP_PATH;
argv[i++] = "pgp";