Article View: news.software.readers
Article #21014PGP signing patch for slrn
From: Felix von Leitner
Date: Sun, 28 Apr 1996 00:00
Date: Sun, 28 Apr 1996 00:00
103 lines
3354 bytes
3354 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hi folks,
I really like to be able to sign my postings. So I hacked slrn a
little. Really nothing much. Just apply the following diff to
slrn/src/post.c.
When it bothers me enough I'll hack a pgp signature check into slrn as
well ;)
Felix
281a282,283
> static char passphrase[1024];
>
298c300
< rsp = slrn_get_response ("yYnNeE", "Post the message? Y-es, N-o, E-dit");
- ---
> rsp = slrn_get_response ("yYnNeEsSpP", "Post the message? Y-es, N-o, E-dit, S-pell check, P-GP sign");
302c304,368
< if (slrn_edit_file (file, 1) < 0) return -1;
- ---
> if (rsp == 's') {
> char cmd[1024] = "ispell -x ";
> strcat( cmd, file );
> slrn_posix_system( cmd, 1 );
> }
> if (rsp == 'p') {
> char cmd[1024] = "pgp -als +batchmode ";
> char tmpfile[256];
> FILE *infp,*outfp,*pp;
> if (passphrase[0]==0) {
> if (slrn_read_input("Passphrase: ",passphrase,0) <= 0) continue;
> }
> if (NULL == (infp = fopen (file, "r+")))
> {
> slrn_error ("File not found: %s--- message not signed.", file);
> return -1;
> }
> outfp=slrn_open_tmpfile(tmpfile,"w");
> for(;;) {
> char line[1024];
> if (fgets(line,1024,infp)==NULL) {
> slrn_error ("No body--- message not signed.");
> return -1;
> }
> if (line[0]=='\n') break;
> }
> for(;;) {
> char line[1024];
> if (fgets(line,1024,infp)==NULL) break;
> fputs(line,outfp);
> }
> rewind(infp);
> fclose(outfp);
> strcat(cmd,tmpfile);
> putenv("PGPPASSFD=0");
> if ((pp=slrn_popen(cmd,"w"))==NULL) {
> fclose(pp);
> return -1;
> }
> fputs(passphrase,pp);
> slrn_pclose (pp);
> for(;;) {
> char line[1024];
> if (fgets(line,1024,infp)==NULL) {
> slrn_error ("No body--- message not signed.");
> return -1;
> }
> if (line[0]=='\n') break;
> }
> fseek(infp,0,1);
> unlink(tmpfile);
> strcat(tmpfile,".asc");
> if ((outfp=fopen(tmpfile,"r"))==NULL) {
> slrn_error ("Cannot open file:%s--- message not signed.",tmpfile);
> return -1;
> }
> for(;;) {
> char line[1024];
> if (fgets(line,1020,outfp)==NULL) break;
> fputs(line,infp);
> }
> fclose(outfp);
> fclose(infp);
> }
> if (rsp == 'e') if (slrn_edit_file (file, 1) < 0) return -1;
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
iQCVAwUBMYMMTR/Da1Yoy+f1AQFjLAP/RgFljerKWTmmrmazZZacBjclJQpPorOE
o4jyjG2xKwbjPr1H3dr4AyjE1lgu4jWdLLcSyAizCTr1B2j40qt8FZi9Ur1m4kVI
ugqilUoHcTlnwHhzmm3H3bzVzIeBwL1aNX5QFRwbUX5AgydYtGrXS/iO5VpaFLgs
h3CLCeUyOSs=
=Mpr1
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<slrn4o632j.hiv.leitner@landau.math.fu-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn4o632j.hiv.leitner@landau.math.fu-berlin.de> Subject: PGP signing patch for slrn Date: Sun, 28 Apr 1996 00:00:00 +0000 From: leitner@landau.math.fu-berlin.de (Felix von Leitner) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 151845264 Organization: Freie Universitaet Berlin X-access: 16 17 19 Reply-to: leitner@prz.tu-berlin.de Newsgroups: news.software.readers