$OpenBSD: patch-kmime_kmime_util_cpp,v 1.2 2014/07/09 20:03:30 zhuk Exp $
MINOR SECURITY FIX. Remove erroneous bikeshedding.
--- kmime/kmime_util.cpp.orig	Thu May  8 11:26:48 2014
+++ kmime/kmime_util.cpp	Sun May 18 20:22:24 2014
@@ -38,6 +38,7 @@
 #include <kcharsets.h>
 #include <kcodecs.h>
 #include <kdebug.h>
+#include <krandom.h>
 
 #include <QtCore/QList>
 #include <QtCore/QString>
@@ -540,29 +541,7 @@ QString decodeRFC2231String( const QByteArray &src )
 
 QByteArray uniqueString()
 {
-  static char chars[] = "0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-  time_t now;
-  char p[11];
-  int pos, ran;
-  unsigned int timeval;
-
-  p[10] = '\0';
-  now = time( 0 );
-  ran = 1 + (int)( 1000.0 * rand() / ( RAND_MAX + 1.0 ) );
-    timeval = ( now / ran ) + getpid();
-
-  for ( int i = 0; i < 10; i++ ) {
-    pos = (int) ( 61.0 * rand() / ( RAND_MAX + 1.0 ) );
-    //kDebug() << pos;
-    p[i] = chars[pos];
-  }
-
-  QByteArray ret;
-  ret.setNum( timeval );
-  ret += '.';
-  ret += p;
-
-  return ret;
+  return KRandom::randomString(32).toLatin1();
 }
 
 QByteArray multiPartBoundary()
