tag 350396 + patch
thanks

Hi!

Here's an even petter patch, that just replaces the urandom stuff with
a pseudo-RN generator.  It now simply uses libcrypto++, rather than the
built-in stuff, too.

I've been using an amule with this patch for a few weeks now; it seems
to work perfectly fine.

--- amule-2.1.0.orig/src/ClientCreditsList.cpp
+++ amule-2.1.0/src/ClientCreditsList.cpp
@@ -41,6 +41,14 @@
 #include "FileFunctions.h"     // Needed for GetFileSize
 #include "CryptoPP_Inc.h"      // Needed for Crypto functions
 
+#include <crypto++/des.h>
+#include <crypto++/files.h>
+#include <crypto++/filters.h>
+#include <crypto++/osrng.h>
+#include <crypto++/oids.h>
+#include <crypto++/ecp.h>
+#include <crypto++/eccrypto.h>
+
 #define CLIENTS_MET_FILENAME           wxT("clients.met")
 #define CLIENTS_MET_BAK_FILENAME       wxT("clients.met.BAK")
 #define CRYPTKEY_FILENAME                      wxT("cryptkey.dat")
@@ -252,7 +260,7 @@
 bool CClientCreditsList::CreateKeyPair()
 {
        try{
-               CryptoPP::AutoSeededRandomPool rng;
+               CryptoPP::AutoSeededX917RNG<CryptoPP::DES_EDE3> rng;
                CryptoPP::InvertibleRSAFunction privkey;
                privkey.Initialize(rng,RSAKEYSIZE);
 
@@ -337,7 +345,7 @@
        
        try {           
                CryptoPP::SecByteBlock sbbSignature(signer->SignatureLength());
-               CryptoPP::AutoSeededRandomPool rng;
+               CryptoPP::AutoSeededX917RNG<CryptoPP::DES_EDE3> rng;
                byte abyBuffer[MAXPUBKEYSIZE+9];
                uint32 keylen = pTarget->GetSecIDKeyLen();
                memcpy(abyBuffer,pTarget->GetSecureIdent(),keylen);
@@ -443,7 +451,7 @@
 #ifdef _DEBUG
 bool CClientCreditsList::Debug_CheckCrypting(){
        // create random key
-       CryptoPP::AutoSeededRandomPool rng;
+       CryptoPP::AutoSeededX917RNG<CryptoPP::DES_EDE3> rng;
 
        CryptoPP::RSASSA_PKCS1v15_SHA_Signer priv(rng, 384);
        CryptoPP::RSASSA_PKCS1v15_SHA_Verifier pub(priv);

-- 
Kind regards,
+--------------------------------------------------------------------+
| Bas Zoetekouw              | GPG key: 0644fab7                     |
|----------------------------| Fingerprint: c1f5 f24c d514 3fec 8bf6 |
| [EMAIL PROTECTED], [EMAIL PROTECTED] |              a2b1 2bae e41f 0644 fab7 |
+--------------------------------------------------------------------+ 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to