🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #247698

Re: uinmyn 0.06

#247698
From: Zax
Date: Fri, 25 Mar 2011 13:25
45 lines
2844 bytes
Here's another one for uinmyn-do-article.py.

This allows for support of hsub's ranging from 48 to 80 chars in length.
They're currently truncated to 48 chars to blend with eSub but it's
worth having the functionality to compare all possible lengths.

Hopefully I've unwrapped the long line this time!  :)


--- uinmyn-do-aam-article.py    2011-03-23 18:08:49.000000000 +0000
+++ uinmyn-do-aam-article.sc.py 2011-03-25 12:09:02.000000000 +0000
@@ -19,7 +19,17 @@
 UINMYN_PENDING_REQUESTS = sys.argv[1]

 posting = email.message_from_file(sys.stdin)
-subject = posting.get('Subject')
+
+# Abort if Subject doesn't exist, otherwise get its length
+if 'Subject' in posting:
+    sublen = len(posting['Subject'])
+else:
+    # No Subject, no hSub.
+    sys.exit(1)
+
+# hSubs must fall within the length criteria
+if sublen < 48 or sublen > 80:
+    sys.exit(1)

 try:
     iv = subject[:16].decode('hex')
@@ -37,7 +47,8 @@


 for key, urls in uinmyn_pending_requests.iteritems():
-    if subject == (iv+sha256(iv+key).digest()).encode('hex')[:48]:
+    hsub = (iv + sha256(iv + key).digest()).encode('hex')[:sublen]
+    if posting['Subject'] == hsub:
         # Doing part of the job in shell:
         gpgproc = Popen('mkfifo $HOME/passwdf ; (echo ' + key + ' > $HOME/passwdf &); gpg --passphrase-fd 3 3<$HOME/passwdf --trust-model always --batch 2>/dev/null ; rm $HOME/passwdf', stdin=PIPE, shell=True)
         gpgproc.stdin.write(posting.get_payload())

-- 
pub  1024D/8ED57743 2003-07-08 Bananasplit Operator
     Key fingerprint = 796F 67E0 E890 A0BB BDAE  EBB4 94A6 7A09 8ED5 7743
uid                            Admin <admin.mixmin.net>
Technical Details
Message-ID: <slrniop5ud.tct.admin@fleegle.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!news.mixmin.net!.POSTED.fleegle.mixmin.net!not-for-mail
References: <20110315104623.F320B81403@fleegle.mixmin.net> <slrniondms.tct.admin@fleegle.mixmin.net> <20110325035845.298EC8144A@fleegle.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrniop5ud.tct.admin@fleegle.mixmin.net>
Subject: Re: uinmyn 0.06
Date: Fri, 25 Mar 2011 13:25:33 +0000
From: Zax <admin@mixmin.net>
References: <20110315104623.F320B81403@fleegle.mixmin.net> <slrniondms.tct.admin@fleegle.mixmin.net> <20110325035845.298EC8144A@fleegle.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!news.mixmin.net!.POSTED.fleegle.mixmin.net!not-for-mail
Newsgroups: alt.privacy.anon-server
Organization: Mixmin
Injection-Date: Fri, 25 Mar 2011 13:25:33 +0000 (UTC)
Injection-Info: news.mixmin.net;
 posting-host="fleegle.mixmin.net:2002:5285:676::1";
 logging-data="24420"; mail-complaints-to="abuse@mixmin.net"
User-Agent: slrn/pre1.0.0-26 (Linux)
Lines: 45
X-Original-Bytes: 2645