mirror of https://github.com/aria2/aria2
2010-01-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without GNUTLS/OpenSSL. * src/util.ccpull/1/head
parent
2eb26c2513
commit
226160f84f
|
@ -1,3 +1,8 @@
|
||||||
|
2010-01-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Fixed compile error without GNUTLS/OpenSSL.
|
||||||
|
* src/util.cc
|
||||||
|
|
||||||
2010-01-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-01-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Changed compression level to Z_DEFAULT_COMPRESSION.
|
Changed compression level to Z_DEFAULT_COMPRESSION.
|
||||||
|
|
|
@ -75,7 +75,9 @@
|
||||||
#include "A2STR.h"
|
#include "A2STR.h"
|
||||||
#include "array_fun.h"
|
#include "array_fun.h"
|
||||||
#include "a2functional.h"
|
#include "a2functional.h"
|
||||||
#include "MessageDigestHelper.h"
|
#ifdef ENABLE_MESSAGE_DIGEST
|
||||||
|
# include "MessageDigestHelper.h"
|
||||||
|
#endif // ENABLE_MESSAGE_DIGEST
|
||||||
|
|
||||||
// For libc6 which doesn't define ULLONG_MAX properly because of broken limits.h
|
// For libc6 which doesn't define ULLONG_MAX properly because of broken limits.h
|
||||||
#ifndef ULLONG_MAX
|
#ifndef ULLONG_MAX
|
||||||
|
@ -1020,10 +1022,14 @@ std::string fixTaintedBasename(const std::string& src)
|
||||||
|
|
||||||
void generateRandomKey(unsigned char* key)
|
void generateRandomKey(unsigned char* key)
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_MESSAGE_DIGEST
|
||||||
unsigned char bytes[40];
|
unsigned char bytes[40];
|
||||||
generateRandomData(bytes, sizeof(bytes));
|
generateRandomData(bytes, sizeof(bytes));
|
||||||
MessageDigestHelper::digest
|
MessageDigestHelper::digest
|
||||||
(key, 20, MessageDigestContext::SHA1, bytes, sizeof(bytes));
|
(key, 20, MessageDigestContext::SHA1, bytes, sizeof(bytes));
|
||||||
|
#else // !ENABLE_MESSAGE_DIGEST
|
||||||
|
generateRandomData(key, 20);
|
||||||
|
#endif // !ENABLE_MESSAGE_DIGEST
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
|
|
Loading…
Reference in New Issue