projects
/
mirror
/
userdir-ldap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a86d975
)
GPG fixes
author
jgg
<>
Wed, 5 Jan 2000 18:17:51 +0000
(18:17 +0000)
committer
jgg
<>
Wed, 5 Jan 2000 18:17:51 +0000
(18:17 +0000)
ud-echelon
patch
|
blob
|
history
userdir_gpg.py
patch
|
blob
|
history
diff --git
a/ud-echelon
b/ud-echelon
index
2be0112
..
0487d94
100755
(executable)
--- a/
ud-echelon
+++ b/
ud-echelon
@@
-1,13
+1,13
@@
#!/usr/bin/env python
# -*- mode: python -*-
#!/usr/bin/env python
# -*- mode: python -*-
-import userdir_gpg, userdir_ldap, sys, traceback, time, ldap, posix;
+import userdir_gpg, userdir_ldap, sys, traceback, time, ldap, posix
, getopt
;
import string, pwd
from userdir_gpg import *;
from userdir_ldap import *;
EX_TEMPFAIL = 75;
EX_PERMFAIL = 65; # EX_DATAERR
import string, pwd
from userdir_gpg import *;
from userdir_ldap import *;
EX_TEMPFAIL = 75;
EX_PERMFAIL = 65; # EX_DATAERR
-Debug =
""
;
+Debug =
None
;
# Try to extract a key fingerprint from a PGP siged message
def TryGPG(Email):
# Try to extract a key fingerprint from a PGP siged message
def TryGPG(Email):
@@
-16,11
+16,12
@@
def TryGPG(Email):
if string.find(Msg[0],"-----BEGIN PGP SIGNED MESSAGE-----") == -1:
return None;
if string.find(Msg[0],"-----BEGIN PGP SIGNED MESSAGE-----") == -1:
return None;
- print Msg[0];
Res = GPGCheckSig(Msg[0]);
# Failed to find a matching sig
if Res[0] != None:
Res = GPGCheckSig(Msg[0]);
# Failed to find a matching sig
if Res[0] != None:
+ S = "%s: %s -> PGP Checking failed '%s': %s %s\n" %(Now,MsgID,Email.getheader("From"),str(Res[0]),str(Res[2]));
+ ErrLog.write(S);
return None;
# Search for the matching key fingerprint
return None;
# Search for the matching key fingerprint
@@
-53,6
+54,12
@@
def TryMatcher(Email):
return None;
return (UID[0],"FROM",Sender);
return None;
return (UID[0],"FROM",Sender);
+
+# Process options
+(options, arguments) = getopt.getopt(sys.argv[1:], "dr")
+for (switch, val) in options:
+ if (switch == '-d'):
+ Debug = "";
# Open the log files
if Debug == None:
# Open the log files
if Debug == None:
diff --git
a/userdir_gpg.py
b/userdir_gpg.py
index
39667d2
..
21bc138
100644
(file)
--- a/
userdir_gpg.py
+++ b/
userdir_gpg.py
@@
-83,7
+83,12
@@
def GetClearSig(Msg):
# Append the PGP boundary header and the signature text to re-form the
# original signed block [needs to convert to \r\n]
# Append the PGP boundary header and the signature text to re-form the
# original signed block [needs to convert to \r\n]
- Output = "-----BEGIN PGP SIGNED MESSAGE-----\r\n\r\n" + Signed.getvalue() + Signature;
+ Output = "-----BEGIN PGP SIGNED MESSAGE-----\r\n";
+ # Semi-evil hack to get the proper hash type inserted in the message
+ if Msg.getparam('micalg') != None:
+ Output = Output + "Hash: %s\r\n"%(string.upper(Msg.getparam('micalg')[4:]));
+ Output = Output + "\r\n";
+ Output = Output + Signed.getvalue() + Signature;
return (Output,1);
else:
# Just return the message body
return (Output,1);
else:
# Just return the message body