Use the common routine from userdir_ldap.py which asks for the
[mirror/userdir-ldap.git] / userdir_gpg.py
index 69ebe34..1f3b1cb 100644 (file)
@@ -1,5 +1,18 @@
- #!/usr/bin/env python
-# -*- mode: python -*-
+#   Copyright (c) 1999-2001  Jason Gunthorpe <jgg@debian.org>
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 # GPG issues - 
 #  - gpgm with a status FD being fed keymaterial and other interesting
@@ -17,7 +30,8 @@ import rfc822, time, fcntl, FCNTL, anydbm
 
 # General GPG options
 GPGPath = "gpg"
-GPGBasicOptions = ["--no-options","--batch","--load-extension","rsa",\
+# "--load-extension","rsa",
+GPGBasicOptions = ["--no-options","--batch",
           "--no-default-keyring","--always-trust"];
 GPGKeyRings = [];
 GPGSigOptions = ["--output","-"];
@@ -115,9 +129,9 @@ def GetClearSig(Msg,Paranoid = 0):
       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 + "Hash: MD5,SHA1,%s\r\n"%(string.upper(Msg.getparam('micalg')[4:]));
       Output = Output + "\r\n";
-      Output = Output +  string.replace(Signed.getvalue(),"\n---","\n- ---") + Signature;
+      Output = Output +  string.replace(Signed.getvalue(),"\n-","\n- -") + Signature;
       return (Output,1);
    else:
       if Paranoid == 0: