Article View: news.software.readers
Article #60303Re: [slrn] rot13 encryption/decryption
From: Renaud Colinet
Date: Sat, 08 Apr 2000 00:00
Date: Sat, 08 Apr 2000 00:00
163 lines
5236 bytes
5236 bytes
On Fri, Apr 7 2000 15:45:15 +0200, Maarten den Braber wrote:
>Hi,
>
>- Does somebody has a patch for slrn 0.9.6.2 to also decrypt
> signatures (as in previous versions?)
I can see 2 solutions to your problem. The first one will always decrypt
signatures, and consists in a single line diff:
#v+
*** art.c.orig Sat Apr 8 13:03:31 2000
--- art.c. Sat Apr 8 13:03:19 2000
***************
*** 7842,7847 ****
--- 7842,7848 ----
case SIGNATURE_LINE:
use_emph_mask = EMPHASIZE_SIGNATURE;
color = SIGNATURE_COLOR;
+ use_rot13 = 1;
break;
case PGP_SIGNATURE_LINE:
#v-
The second solution defines a new configuration variable,
rot13_decoded_text_mask (inspired from emphasized_text_mask), that
allows you to choose whether you want to decrypt text, signature, or
both. You have to add this to your .slrnrc:
% rot13_decoded_text_mask determines to which portion of hte text rot13
% decoding should be applied.
% Set to 1 to decode the article (including quotes)
% Set to 2 to decode the signature only
% Set to 3 to decode both article and signature
set rot13_decoded_text_mask 3
The patch follows:
#v+
*** art.h.orig Sat Apr 8 12:44:19 2000
--- art.h Tue Feb 15 17:24:01 2000
***************
*** 64,69 ****
--- 64,70 ----
#endif
extern int Slrn_Emphasized_Text_Mode;
extern int Slrn_Emphasized_Text_Mask;
+ extern int Slrn_Rot13_Decoded_Text_Mask;
extern int Slrn_New_Subject_Breaks_Threads;
extern int Slrn_Sig_Is_End_Of_Article;
extern int Slrn_Del_Article_Upon_Read;
*** art.c.orig Sat Apr 8 12:44:10 2000
--- art.c Sat Apr 8 12:47:29 2000
***************
*** 115,120 ****
--- 115,124 ----
int Slrn_Process_Verbatum_Marks = 1;
+ #define ROT13_DECODE_ARTICLE 1
+ #define ROT13_DECODE_SIGNATURE 2
+ int Slrn_Rot13_Decoded_Text_Mask = ROT13_DECODE_ARTICLE;
+
Slrn_Article_Type *Slrn_Current_Article;
#if SLRN_HAS_TILDE_FEATURE
***************
*** 7814,7820 ****
char *lbuf = l->buf;
int color;
int use_emph_mask = 0;
! int use_rot13 = 0;
switch (l->flags & LINE_TYPE_MASK)
{
--- 7818,7824 ----
char *lbuf = l->buf;
int color;
int use_emph_mask = 0;
! int use_rot13_mask = 0;
switch (l->flags & LINE_TYPE_MASK)
{
***************
*** 7836,7847 ****
case QUOTE_LINE:
color = QUOTE_COLOR + QUOTE_LEVEL(l->flags);
use_emph_mask = EMPHASIZE_QUOTES;
! use_rot13 = 1;
break;
case SIGNATURE_LINE:
use_emph_mask = EMPHASIZE_SIGNATURE;
color = SIGNATURE_COLOR;
break;
case PGP_SIGNATURE_LINE:
--- 7840,7852 ----
case QUOTE_LINE:
color = QUOTE_COLOR + QUOTE_LEVEL(l->flags);
use_emph_mask = EMPHASIZE_QUOTES;
! use_rot13_mask = ROT13_DECODE_ARTICLE;
break;
case SIGNATURE_LINE:
use_emph_mask = EMPHASIZE_SIGNATURE;
color = SIGNATURE_COLOR;
+ use_rot13_mask = ROT13_DECODE_SIGNATURE;
break;
case PGP_SIGNATURE_LINE:
***************
*** 7855,7861 ****
default:
color = ARTICLE_COLOR;
use_emph_mask = EMPHASIZE_ARTICLE;
! use_rot13 = 1;
}
slrn_set_color (color);
--- 7860,7866 ----
default:
color = ARTICLE_COLOR;
use_emph_mask = EMPHASIZE_ARTICLE;
! use_rot13_mask = ROT13_DECODE_ARTICLE;
}
slrn_set_color (color);
***************
*** 7869,7876 ****
#endif
use_emph_mask &= Slrn_Emphasized_Text_Mask;
! if (Do_Rot13 && use_rot13)
{
write_rot13 ((unsigned char *) lbuf, use_emph_mask, color);
return;
--- 7874,7883 ----
#endif
use_emph_mask &= Slrn_Emphasized_Text_Mask;
+ use_rot13_mask &= Slrn_Rot13_Decoded_Text_Mask;
+
! if (Do_Rot13 && use_rot13_mask)
{
write_rot13 ((unsigned char *) lbuf, use_emph_mask, color);
return;
*** startup.c.orig Sat Apr 8 12:43:54 2000
--- startup.c Fri Apr 7 17:22:25 2000
***************
*** 334,339 ****
--- 334,340 ----
{"hide_signature", &Slrn_Signature_Hidden},
{"hide_pgpsignature", &Slrn_Pgp_Signature_Hidden},
{"emphasized_text_mask", &Slrn_Emphasized_Text_Mask},
+ {"rot13_decoded_text_mask", &Slrn_Rot13_Decoded_Text_Mask},
{"emphasized_text_mode", &Slrn_Emphasized_Text_Mode},
{"process_verbatum_marks", &Slrn_Process_Verbatum_Marks},
#v-
--
Renaud
Technical Details
Message-ID:
<slrn8eu5hn.iq7.colinet@beige4.ensta.fr>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-mailReferences:
<slrn8erpja.60.mdb@tornado.twister.cx>Show Full Headers
Complete Article Headers
Message-ID: <slrn8eu5hn.iq7.colinet@beige4.ensta.fr> Subject: Re: [slrn] rot13 encryption/decryption Date: Sat, 08 Apr 2000 00:00:00 +0000 From: colinet@pervenche10.ensta.fr (Renaud Colinet) References: <slrn8erpja.60.mdb@tornado.twister.cx> 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: 608328481 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Organization: Ecole Nationale Superieure de Techniques Avancees (ENSTA), Paris Mime-Version: 1.0 User-Agent: slrn/0.9.6.2 (Linux) Reply-To: colinet@saumon4.ensta.fr Newsgroups: news.software.readers