Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need PGP/PINE patches

6 views
Skip to first unread message

Christopher Wiles

unread,
Apr 24, 1994, 9:14:36 PM4/24/94
to
A couple of weeks ago, a bright fellow posted a patch for PINE that
allows PGP encryption/decryption.

Today, the system administrator at my home site requested/demanded that I
make the modification to PINE. Unfortunately, I failed to preserve the
patch ...

... so, could someone please mail the patch to wil...@quark.chs.wa.com or
wil...@halcyon.com? I'd be most grateful.

-- Chris

Gary Heavysege

unread,
Apr 25, 1994, 6:42:57 PM4/25/94
to

|> -- Chris

Upon seeing this, Gary Heavysege <co...@crl.com> pleaded:

I managed to miss that patch, somehow...could you either mail it to
co...@crl.com or co...@suuper.suu.edu, also? Or repost it to the group?

Thanks!

Gary
---
co...@crl.com

-=Xenon=-

unread,
Apr 25, 1994, 10:47:09 PM4/25/94
to
I've never used this....

Article 10548 of alt.security.pgp:
Path: From: mcq...@next.duq.edu (Tod McQuillin)
Newsgroups: alt.security.pgp
Subject: Patches for PINE 3.89
Date: 25 Mar 1994 05:50:20 GMT
Organization: Duquesne University, Pittsburgh, PA
Lines: 236
Message-ID: <2mtu2s$q...@godot.cc.duq.edu>
NNTP-Posting-Host: keen.ccit.duq.edu
X-Newsreader: TIN [version 1.2 PL2]

I have made changes to Pine 3.89 which integrates PGP encryption into
the message editor. To use it, you must have the line

feature-level=old-growth

in your .pinerc file.

After entering your message into the composer, you can press '^]' to
fire off PGP encryption. You can add a PGP signature, encrypt the
message with one (or more) public keys, or both.

Note that '^]' is the default telnet escape character, so if you are
telnetting to the machine where pine is running, you will have to
enter "send esc" at the telnet> prompt after typeing '^]'.

Here are the changes. cd to pine3.89/pico and enter
"patch < thisfile". Recompile the stuff in the pico directory, then
cd ../pine and relink pine.

*** 1.1 1994/03/25 02:06:13
--- ebind.h 1994/03/25 02:10:35
***************
*** 118,123 ****
--- 118,124 ----
{CTRL|'^', setmark},
#ifdef JOB_CONTROL
{CTRL|'_', alt_editor},
+ {CTRL|']', pgp_encrypt},
#endif
{0x7F, backdel},
{0, NULL}
*** 1.1 1994/03/25 02:56:13
--- efunc.h 1994/03/25 04:19:57
***************
*** 182,187 ****
--- 182,188 ----
extern int GetKey(void);
#ifdef JOB_CONTROL
extern int alt_editor(int, int);
+ extern int pgp_encrypt(int, int);
extern int bktoshell(void);
#endif
extern int fallowc(int);
*** 1.1 1994/03/25 02:11:58
--- os_unix.c 1994/03/25 05:31:57
***************
*** 670,676 ****
--- 670,857 ----
refresh(0, 1); /* redraw */
}

+ /*
+ * pgp_encrypt - fork off a pgp process to encrypt the message buffer
+ */
+ pgp_encrypt(f, n)
+ {
+ char reckey[NLINE]; /* recipient key name */
+ char pgpcmd[NLINE];
+ char *fn; /* tmp holder for
file name */
+ char *cp, cpbuf[NLINE];
+ char *args[MAXARGS]; /* ptrs into edit command */
+ char *writetmp();
+ int child, pid, i, done = 0, signing = 0, encrypting = 0;
+ long l;
+ #if defined(POSIX) || defined(sv3) || defined(COHERENT) || defined(isc)
+ int stat;
+ #else
+ union wait stat;
+ #endif
+ FILE *p;
+ SIGTYPE (*ohup)(), (*oint)(), (*osize)(), (*ostop)(), (*ostart)();

+ if(Pmaster == NULL)
+ return;
+
+ if(gmode&MDSCUR){
+ emlwrite("PGP encryption not available in restricted mode", NULL);
+ return;
+ }
+
+ if(!(gmode&MDADVN)){
+ emlwrite("\007Unknown Command",NULL);
+ return;
+ }
+
+ signing = mlyesno("Sign message with your private key", 0);
+ if (signing == ABORT)
+ return -1;
+ if (signing) {
+ encrypting = mlyesno("Encrypt message using a public key", 1);
+ if (encrypting == ABORT)
+ return -1;
+ } else {
+ encrypting = TRUE;
+ }
+
+ if (encrypting) {
+ *reckey = '\0';
+
+ while(!done){
+ pid = mlreplyd("Use whose public key? ", reckey, NLINE, QDEFLT);
+
+ switch(pid){
+ case ABORT:
+ return(-1);
+ case HELPCH:
+ emlwrite("no PGP help yet", NULL);
+ sleep(1);
+ break;
+ case (CTRL|'L'):
+ sgarbf = TRUE;
+ update();
+ break;
+ case TRUE:
+ case FALSE:
+ if(*reckey == '\0'){ /* leave silently? */
+ mlerase();
+ return(-1);
+ }
+
+ done++;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ if((fn=writetmp(0, 1)) == NULL){ /* get temp file */
+ emlwrite("Problem writing temp file for PGP encrypt", NULL);
+ return(-1);
+ }
+
+ sprintf(pgpcmd, "pgp %s -%s%sat %s %s",
+ (signing && !encrypting) ? "+clearsig=on" : "",
+ encrypting ? "e" : "",
+ signing ? "s" : "",
+ fn, encrypting ? reckey : "");
+
+ cp = cpbuf;
+ strcpy(cp, pgpcmd);
+ for(i=0; *cp != '\0';i++){ /* build args
array */
+ if(i < MAXARGS){
+ args[i] = NULL; /* in case we break out */
+ }
+ else{
+ emlwrite("Too many args for command!", NULL);
+ return(-1);
+ }
+
+ while(isspace(*cp))
+ if(*cp != '\0')
+ cp++;
+ else
+ break;
+
+ args[i] = cp;
+
+ while(!isspace(*cp))
+ if(*cp != '\0')
+ cp++;
+ else
+ break;
+
+ if(*cp != '\0')
+ *cp++ = '\0';
+ }
+
+ args[i] = NULL;
+
+ if(Pmaster)
+ (*Pmaster->raw_io)(0); /* turn OFF raw mode */
+
+ {
+ char msg[80];
+
+ sprintf(msg, "\n\n\n\n\nRunning %s\n", pgpcmd);
+ write(1, msg, strlen(msg));
+ }
+
+ if(child=fork()){ /* wait for the child to finish */
+ ohup = signal(SIGHUP, SIG_IGN); /* ignore signals for now */
+ oint = signal(SIGINT, SIG_IGN);
+ #ifdef TIOCGWINSZ
+ osize = signal(SIGWINCH, SIG_IGN);
+ #endif
+
+ /*
+ * BUG - wait should be made non-blocking and mail_pings or something
+ * need to be done in the loop to keep the imap stream alive
+ */
+ while((pid=(int)wait(&stat)) != child)
+ ;
+
+ signal(SIGHUP, ohup); /* restore signals */
+ signal(SIGINT, oint);
+ #ifdef TIOCGWINSZ
+ signal(SIGWINCH, osize);
+ #endif
+ }
+ else{ /* spawn editor */
+ signal(SIGHUP, SIG_DFL); /* let editor handle signals */
+ signal(SIGINT, SIG_DFL);
+ #ifdef TIOCGWINSZ
+ signal(SIGWINCH, SIG_DFL);
+ #endif
+ if(execvp(args[0], args) < 0)
+ exit(1);
+ }
+
+ if(Pmaster)
+ (*Pmaster->raw_io)(1); /* turn ON raw mode */
+
+ #if defined(POSIX) || defined(sv3) || defined(COHERENT) || defined(isc)
+ if (stat == 0) {
+ #else
+ if (stat.w_termsig == 0 && stat.w_coredump == 0 && stat.w_retcode
== 0) {
+ #endif
+ /*
+ * replace edited text with new text
+ */
+ curbp->b_flag &= ~BFCHG; /* make sure old text
gets blasted */
+ unlink(fn); /* erase cleartext */
+ strcat(fn, ".asc"); /* file made by pgp */
+ readin(fn, 0); /* read new text overwriting old */
+ curbp->b_flag |= BFCHG; /* mark dirty for packbuf() */
+ } else {
+ emlwrite("Command \"%s\" exited badly.", pgpcmd);
+ }
+ unlink(fn); /* blast temp file */
+ ttopen(); /* reset the signals */
+ refresh(0, 1); /* redraw */
+ }

/*
* bktoshell - suspend and wait to be woken up



David Casti

unread,
Apr 26, 1994, 3:38:56 PM4/26/94
to
Christopher Wiles (wil...@chinook.halcyon.com) wrote:
: A couple of weeks ago, a bright fellow posted a patch for PINE that
: allows PGP encryption/decryption.

Hmmm... I've seen a patch which will *encrypt*, but not decrypt. Do you
have a patch which does both?

David.

0 new messages