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

List:       kde-pim
Subject:    [Kde-pim] [PATCH] Kleo::KeySelectionDialog allows selecting invalid
From:       Stefan Gehn <mETz81 () web ! de>
Date:       2006-05-05 21:01:47
Message-ID: 200605052301.48127.mETz81 () web ! de
[Download RAW message or body]

Moin,

just stumbled across this small race-condition. If you're fast enough you can 
select an invalid key for signing/encrypting. Fast enough here means 
selecting a key and clicking OK before slotCheckSelection() is called (it's 
async).

The problem is in Kleo::KeySelectionDialog::slotOk() where the key-selection 
gets checked one last time. If that check disables the OK button, accept() is 
called nevertheless and one ends up with an key that is not usable for 
signing/encryption.

Attached is a patch against 3.5 branch that applies inside 
kdepim/certmanager/lib

Would be cool if somebody can check if I can commit this :)

Bye,
Stefan aka mETz

["libkleo_fix_keyselection.diff" (text/x-diff)]

Index: ui/keyselectiondialog.cpp
===================================================================
--- ui/keyselectiondialog.cpp	(Revision 537741)
+++ ui/keyselectiondialog.cpp	(Arbeitskopie)
@@ -687,6 +687,9 @@
 void Kleo::KeySelectionDialog::slotOk() {
   if ( mCheckSelectionTimer->isActive() )
     slotCheckSelection();
+  // button could be disabled again after checking the selected key
+  if ( !actionButton( Ok )->isEnabled() )
+    return;
   mStartSearchTimer->stop();
   accept();
 }


_______________________________________________
kde-pim mailing list
kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

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

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