[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    [PATCH] Fix loose ends in crypto support: pt.6-10/12: this & that
From:       Marc Mutz <marc () klaralvdalens-datakonsult ! se>
Date:       2004-05-31 13:56:09
Message-ID: 200405311556.18634.marc () klaralvdalens-datakonsult ! se
[Download RAW message or body]

Hi!

This is a collection of small patched that should round up all the changes we 
have done in ae_b in KMail:

ae2-configable-key-import:
depends: -
This implements the config option that allows the user to suppress automagic 
import of attached certificates. Call it a security bugfix, if you must :)

ae2-kconf_update:
depends: -
This includes the kconf_update entries in kmstartup.cpp, kmail.upd (the script 
is already committed, but not yet installed, this patch does the latter).

ae2-dont-send-mdns-on-enc-mail:
depends: -
This implements the config option that allows the user to suppress sending of 
MDNs on encrypted messages.

ae2-ifdef-to-hidden-config-key:
depends: -
This just turns #ifdef'ed code into if ( config.readBoolEntry() )'ed code in 
the reader.

ae2-update-features:
depends: -
Updates the new features section with the entries from aegypten_branch.

Marc

-- 
Marc Mutz -- marc@klaralvdalens-datakonsult.se, mutz@kde.org
Klarälvdalens Datakonsult AB, Platform-independent software solutions

["ae2-configable-key-import.diff" (text/x-diff)]

Index: objecttreeparser.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/objecttreeparser.cpp,v
retrieving revision 1.109
diff -u -3 -p -r1.109 objecttreeparser.cpp
--- objecttreeparser.cpp	31 May 2004 11:27:20 -0000	1.109
+++ objecttreeparser.cpp	31 May 2004 11:36:23 -0000
@@ -1436,6 +1436,10 @@ namespace KMail {
       if ( !smimeCrypto )
         return false;
 
+      const KConfigGroup reader( KMKernel::config(), "Reader" );
+      if ( !reader.readBoolEntry( "AutoImportKeys", false ) )
+        return false;
+
       const QByteArray certData = node->msgPart().bodyDecodedBinary();
 
       const GpgME::ImportResult res

["ae2-kconf_upgrade.diff" (text/x-diff)]

Index: kmstartup.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmstartup.cpp,v
retrieving revision 1.33
diff -u -3 -p -r1.33 kmstartup.cpp
--- kmstartup.cpp	31 May 2004 13:17:03 -0000	1.33
+++ kmstartup.cpp	31 May 2004 13:26:11 -0000
@@ -90,6 +90,8 @@ void checkConfigUpdates() {
     "3.3-use-ID-for-accounts",
     "3.3-update-filter-rules",
     "3.3-move-identities-to-own-file"
+    "3.3-aegypten-kpgprc-to-kmailrc",
+    "3.3-aegypten-kpgprc-to-libkleopatrarc"
   };
   static const int numUpdates = sizeof updates / sizeof *updates;
   // Warning: do not remove entries in the above array, or the update-level check below will break
Index: kmail.upd
===================================================================
RCS file: /home/kde/kdepim/kmail/kmail.upd,v
retrieving revision 1.21
diff -u -3 -p -r1.21 kmail.upd
--- kmail.upd	14 May 2004 11:44:36 -0000	1.21
+++ kmail.upd	31 May 2004 13:26:11 -0000
@@ -102,6 +102,21 @@ Id=3.3-move-identities-to-own-file
 File=kmailrc,emailidentities
 Script=kmail-3.3-move-identities.pl,perl
 #
+# aegypten: moving options from kpgprc to kmailrc
+#
+Id=3.3-aegypten-kpgprc-to-kmailrc
+File=kpgprc,kmailrc
+Group=,Composer
+Key=showEncryptionResult,crypto-show-encryption-result
+Key=encryptToSelf,crypto-encrypt-to-self
+Key=showKeysForApproval,crypto-show-keys-for-approval
+
+Id=3.3-aegypten-kpgprc-to-libkleopatrarc
+File=kpgprc,libkleopatrarc
+Group=,Backends
+Script=kmail-3.3-aegypten.sh
+
+#
 # Important notice:
 # If you add updates here, keep this text below them.
 # Make sure your updates can be safely run twice and add any new Id
Index: kmail-3.3-move-identities.pl
===================================================================
RCS file: /home/kde/kdepim/kmail/kmail-3.3-move-identities.pl,v
retrieving revision 1.1
diff -u -3 -p -r1.1 kmail-3.3-move-identities.pl
--- kmail-3.3-move-identities.pl	14 May 2004 11:44:36 -0000	1.1
+++ kmail-3.3-move-identities.pl	31 May 2004 13:26:11 -0000
@@ -2,7 +2,9 @@
 # David Faure <faure@kde.org>
 # License: GPL
 
-$currentGroup = "";
+use strict;
+
+my $currentGroup = "";
 
 while (<>) {
     next if /^$/;
@@ -17,11 +19,19 @@ while (<>) {
     };
     # Move over keys from the identity groups
     if ( $currentGroup =~ /^Identity/ ) {
-        print;
+	if ( /^Default PGP Key=/ ) {
+	    # copy "Default PGP Key" into "PGP {Signing,Encryption} Key"
+	    my ($key,$value) = split /=/;
+	    chomp $value;
+	    print "PGP Signing Key=$value\n";
+	    print "PGP Encryption Key=$value\n";
+	} else {
+	    print;
+	}
     }
     # Move over the key for the default identity
     elsif ( $currentGroup eq 'General' ) {
-	($key,$value) = split /=/;
+	my ($key,$value) = split /=/;
 	chomp $value;
         if ( $key eq 'Default Identity' ) {
             print "[$currentGroup]\n$key=$value\n";
Index: Makefile.am
===================================================================
RCS file: /home/kde/kdepim/kmail/Makefile.am,v
retrieving revision 1.274
diff -u -3 -p -r1.274 Makefile.am
--- Makefile.am	31 May 2004 12:48:40 -0000	1.274
+++ Makefile.am	31 May 2004 13:28:11 -0000
@@ -141,7 +141,8 @@ update_SCRIPTS = upgrade-transport.pl km
 		kmail-3.2-update-loop-on-goto-unread-settings.sh \
 		kmail-3.2-misc.sh \
 		kmail-3.3-use-ID-for-accounts.pl \
-		kmail-3.3-move-identities.pl
+		kmail-3.3-move-identities.pl \
+		kmail-3.3-aegypten.sh
 
 confdir = $(kde_confdir)
 conf_DATA = kmail.antispamrc

["ae2-dont-send-mdns-on-enc-mail.diff" (text/x-diff)]

Index: kmreaderwin.h
===================================================================
RCS file: /home/kde/kdepim/kmail/kmreaderwin.h,v
retrieving revision 1.194
diff -u -3 -p -r1.194 kmreaderwin.h
--- kmreaderwin.h	22 May 2004 14:48:49 -0000	1.194
+++ kmreaderwin.h	31 May 2004 13:47:41 -0000
@@ -415,6 +415,7 @@ private:
   QTimer mDelayedMarkTimer;
   const QTextCodec * mOverrideCodec;
   bool mMsgDisplay;
+  bool mNoMDNsWhenEncrypted;
   unsigned long mLastSerNum;
   KMMsgStatus mLastStatus;
 
Index: kmreaderwin.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmreaderwin.cpp,v
retrieving revision 1.765
diff -u -3 -p -r1.765 kmreaderwin.cpp
--- kmreaderwin.cpp	25 May 2004 13:19:32 -0000	1.765
+++ kmreaderwin.cpp	31 May 2004 13:47:41 -0000
@@ -656,11 +654,14 @@ bool KMReaderWin::event(QEvent *e)
 //-----------------------------------------------------------------------------
 void KMReaderWin::readConfig(void)
 {
+  const KConfigGroup mdnGroup( KMKernel::config(), "MDN" );
   /*should be: const*/ KConfigGroup reader( KMKernel::config(), "Reader" );
 
   delete mCSSHelper;
   mCSSHelper = new CSSHelper( QPaintDeviceMetrics( mViewer->view() ), this );
 
+  mNoMDNsWhenEncrypted = mdnGroup.readBoolEntry( "not-send-when-encrypted", true );
+  
   // initialize useFixedFont from the saved value; the corresponding toggle
   // action is initialized in the main window
   mUseFixedFont = reader.readBoolEntry( "useFixedFont", false );
@@ -1399,12 +1407,13 @@ void KMReaderWin::slotTouchMessage()
       serNums.append( message()->getMsgSerNum() );
       KMCommand *command = new KMSetStatusCommand( KMMsgStatusRead, serNums );
       command->start();
-      KMMessage * receipt = message()->createMDN( MDN::ManualAction,
-                                                  MDN::Displayed,
-                                                  true /* allow GUI */ );
-      if ( receipt )
-        if ( !kmkernel->msgSender()->send( receipt ) ) // send or queue
-          KMessageBox::error( this, i18n("Could not send MDN.") );
+      if ( ! ( mNoMDNsWhenEncrypted &&
+               KMMsgNotEncrypted != message()->encryptionState() ) )
+	if ( KMMessage * receipt = message()->createMDN( MDN::ManualAction,
+							 MDN::Displayed,
+							 true /* allow GUI */ ) )
+	  if ( !kmkernel->msgSender()->send( receipt ) ) // send or queue
+	    KMessageBox::error( this, i18n("Could not send MDN.") );
     }
   }
 }

["ae2-ifdef-to-hidden-config-key.diff" (text/x-diff)]

Index: kmreaderwin.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmreaderwin.cpp,v
retrieving revision 1.765
diff -u -3 -p -r1.765 kmreaderwin.cpp
--- kmreaderwin.cpp	25 May 2004 13:19:32 -0000	1.765
+++ kmreaderwin.cpp	31 May 2004 13:47:41 -0000
@@ -2,8 +2,6 @@
 // kmreaderwin.cpp
 // Author: Markus Wuebben <markus.wuebben@kde.org>
 
-// #define STRICT_RULES_OF_GERMAN_GOVERNMENT_02
-
 // define this to copy all html that is written to the readerwindow to
 // filehtmlwriter.out in the current working directory
 //#define KMAIL_READER_HTML_DEBUG 1
@@ -1182,9 +1191,8 @@ void KMReaderWin::parseMsg(KMMessage* aM
   aMsg->setSignatureState(  signatureState  );
 
   bool emitReplaceMsgByUnencryptedVersion = false;
-// note: The following define is specified on top of this file. To compile
-//       a less strict version of KMail just comment it out there above.
-#ifdef STRICT_RULES_OF_GERMAN_GOVERNMENT_02
+  const KConfigGroup reader( KMKernel::config(), "Reader" );
+  if ( reader.readBoolEntry( "store-displayed-messages-unencrypted", false ) ) {
 
   // Hack to make sure the S/MIME CryptPlugs follows the strict requirement
   // of german government:
@@ -1249,7 +1257,7 @@ kdDebug(5006) << "KMReaderWin  -  attach
       emitReplaceMsgByUnencryptedVersion = true;
     }
   }
-#endif // STRICT_RULES_OF_GERMAN_GOVERNMENT_02
+  }
 
   // save current main Content-Type before deleting mRootNode
   const int rootNodeCntType = mRootNode ? mRootNode->type() : DwMime::kTypeText;

["ae2-update-features.diff" (text/x-diff)]

Index: kmreaderwin.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmreaderwin.cpp,v
retrieving revision 1.765
diff -u -3 -p -r1.765 kmreaderwin.cpp
--- kmreaderwin.cpp	25 May 2004 13:19:32 -0000	1.765
+++ kmreaderwin.cpp	31 May 2004 13:47:41 -0000
@@ -926,9 +927,12 @@ void KMReaderWin::clearCache()
 
 // enter items for the "Important changes" list here:
 static const char * const kmailChanges[] = {
+  I18N_NOOP("Support for 3rd-party CryptPlugs has been discontinued. "
+	    "Support for the GnuPG cryptographic backend is now included "
+	    "directly in KMail.")
 };
-static const int numKMailChanges = 0;
-//  sizeof kmailChanges / sizeof *kmailChanges;
+static const int numKMailChanges =
+  sizeof kmailChanges / sizeof *kmailChanges;
 
 // enter items for the "new features" list here, so the main body of
 // the welcome page can be left untouched (probably much easier for
@@ -942,6 +946,11 @@ static const char * const kmailNewFeatur
   I18N_NOOP( "View/open message files" ),
   I18N_NOOP( "HTML message composing" ),
   I18N_NOOP( "New filter criteria: in address book, in category, has attachment" )
+  I18N_NOOP("Cryptographic backend auto-configuration"),
+  I18N_NOOP("Sign/encrypt key separation"),
+  I18N_NOOP("Per-identity S/MIME key preselection"),
+  I18N_NOOP("Per-identity cryptographic message format preselection"),
+  I18N_NOOP("Per-contact crypto preferences"),
 };
 static const int numKMailNewFeatures =
   sizeof kmailNewFeatures / sizeof *kmailNewFeatures;


_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic