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:
@@ -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++) {
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#ifndef TOOLS_H
|
||||
#define TOOLS_H
|
||||
|
||||
#include <limits>
|
||||
|
||||
|
||||
class Tools{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user