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

List:       kde-bugs-dist
Subject:    [Bug 74314] kded crash, backtrace included
From:       Aaron Williams <aaron_williams () net ! com>
Date:       2004-04-01 18:52:31
Message-ID: 20040401185231.12377.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
      
http://bugs.kde.org/show_bug.cgi?id=74314      




------- Additional Comments From aaron_williams net com  2004-04-01 20:52 -------
Try this:

diff -u kwalletbackend.cc.orig kwalletbackend.cc
--- kwalletbackend.cc.orig      2004-04-01 10:43:05.470005000 -0800
+++ kwalletbackend.cc   2004-04-01 10:37:09.790009000 -0800
 @ -122,6 +122,19  @

        // EGD method?

+        char *randFilename;
+        if ((randFilename = getenv("RANDFILE"))) {
+                if (QFile::exists(randFilename)) {
+                        QFile devrand(randFilename);
+                        if (devrand.open(IO_ReadOnly)) {
+                                unsigned int rc = 
devrand.readBlock(randBlock.data(), randBlock.size());
+                                if (rc != randBlock.size()) {
+                                        return -3;      // not enough 
data read
+                                }
+                                return 0;
+                        }
+                }
+        }
        // Couldn't get any random data!!

        return -1;

Note that the OpenSSL configuration also allows you to specify the path 
to an entropy file.  Not sure how to get the config info, though.  
OpenSSL will also work if the RANDFILE environment variable is set so I 
use that.  Ideally it should use both.

-Aaron

George Staikos wrote:

>------- You are receiving this mail because: -------
>You reported the bug, or are watching the reporter.
>      
>http://bugs.kde.org/show_bug.cgi?id=74314      
>staikos kde org changed:
>
>           What    |Removed                     |Added
>----------------------------------------------------------------------------
>             Status|UNCONFIRMED                 |RESOLVED
>         Resolution|                            |FIXED
>
>
>
>------- Additional Comments From staikos kde org  2004-04-01 06:58 -------
>CVS commit by staikos: 
>
>don't write junk files if we read in junk, don't crash when reading in junk.
>
>Note to solaris users: If you want this to work, please send me a patch.  I
>don't have time to write EGD code for this.  The place is already marked in
>kwalletbackend.cc for you to fill in.
>
>CCMAIL: 74314-done bugs kde org
>
>
>  M +12 -0     kwalletbackend.cc   1.47
>
>
>--- kdelibs/kwallet/backend/kwalletbackend.cc  #1.46:1.47
> @ -323,4 +323,10  @ int Backend::open(const QByteArray& pass
>         bf.setKey((void *)passhash.data(), passhash.size()*8);
> 
>+        if (!encrypted.data()) {
>+                passhash.fill(0);
>+                encrypted.fill(0);
>+                return -7; // file structure error
>+        }
>+
>         int rc = bf.decrypt(encrypted.data(), encrypted.size());
>         if (rc < 0) {
> @ -434,4 +440,5  @ int Backend::sync(const QByteArray& pass
> 
>         if (!qf) {
>+                sf.abort();
>                 return -1;              // error opening file
>         }
> @ -517,4 +524,5  @ int Backend::sync(const QByteArray& pass
>                 sha.reset();
>                 decrypted.fill(0);
>+                sf.abort();
>                 return -3;              // Fatal error: can't get random
>         }
> @ -552,4 +560,5  @ int Backend::sync(const QByteArray& pass
>                 passhash.fill(0);
>                 wholeFile.fill(0);
>+                sf.abort();
>                 return -2;
>         }
> @ -559,4 +568,5  @ int Backend::sync(const QByteArray& pass
>                 passhash.fill(0);
>                 wholeFile.fill(0);
>+                sf.abort();
>                 return -2;      // encrypt error
>         }
> @ -567,4 +577,6  @ int Backend::sync(const QByteArray& pass
>         qf->writeBlock(wholeFile, wholeFile.size());
>         if (!sf.close()) {
>+                wholeFile.fill(0);
>+                sf.abort();
>                 return -4; // write error
>         }
>  
>
[prev in list] [next in list] [prev in thread] [next in thread] 

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