Now using openssl on windows instead of ms crypto api. Can't stand all these handles for the crypto api, openssl will be required later anyway. MD5 sums will be used when transfering avatars for efficient caching - avatars are identified by their MD5 sum.

Sorry for making it even harder to compile on windows...
This commit is contained in:
lotodore
2007-09-08 11:00:46 +00:00
parent c5c6bec710
commit d0898ed336
10 changed files with 26 additions and 119 deletions
+13 -3
View File
@@ -17,8 +17,12 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#define NOMINMAX // for Windows
#include "tools.h"
#include <core/rand.h>
#include <openssl/rand.h>
#include <limits>
using namespace std;
@@ -34,7 +38,10 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
for (i=0; i<howMany; i++) {
RandomBytes(rand_buf,4);
if(!RAND_bytes(rand_buf, 4))
{
RAND_pseudo_bytes(rand_buf, 4);
}
randNumber = 0;
for(j=0; j<4; j++) {
@@ -55,7 +62,10 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
int counter(0);
while (counter < howMany) {
RandomBytes(rand_buf,4);
if(!RAND_bytes(rand_buf, 4))
{
RAND_pseudo_bytes(rand_buf, 4);
}
randNumber = 0;
for(j=0; j<4; j++) {
-2
View File
@@ -20,8 +20,6 @@
#ifndef TOOLS_H
#define TOOLS_H
#include <limits>
class Tools{
public: