Ver código fonte

2008-04-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

        Fixed compile error without gnutls/libgcrypt/libgpg-error and 
openSSL
        installed
        * src/ARC4Encryptor.h
        * src/ARC4Decryptor.h
Tatsuhiro Tsujikawa 17 anos atrás
pai
commit
0516a07fa6
3 arquivos alterados com 49 adições e 2 exclusões
  1. 7 0
      ChangeLog
  2. 21 1
      src/ARC4Decryptor.h
  3. 21 1
      src/ARC4Encryptor.h

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2008-04-13  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+        Fixed compile error without gnutls/libgcrypt/libgpg-error and openSSL
+        installed
+        * src/ARC4Encryptor.h
+        * src/ARC4Decryptor.h
+
 2008-04-13  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
         Renamed argument from 'errno' to 'err', since errno is confused with

+ 21 - 1
src/ARC4Decryptor.h

@@ -40,6 +40,26 @@
 # include "LibgcryptARC4Decryptor.h"
 #elif HAVE_LIBSSL
 # include "LibsslARC4Decryptor.h"
-#endif // HAVE_LIBSSL
+#else
+
+// provide empty implementation to compile sources without both libgcrypt and
+// openssl installed
+namespace aria2 {
+
+class ARC4Decryptor {
+public:
+  ARC4Decryptor() {}
+
+  ~ARC4Decryptor() {}
+
+  void init(const unsigned char* key, size_t keyLength) {}
+
+  void decrypt(unsigned char* out, size_t outLength,
+	       const unsigned char* in, size_t inLength) {}
+};
+
+} // namespace aria2
+
+#endif
 
 #endif // _D_ARC4_DECRYPTOR_H_

+ 21 - 1
src/ARC4Encryptor.h

@@ -40,6 +40,26 @@
 # include "LibgcryptARC4Encryptor.h"
 #elif HAVE_LIBSSL
 # include "LibsslARC4Encryptor.h"
-#endif // HAVE_LIBSSL
+#else
+
+// provide empty implementation to compile sources without both libgcrypt and
+// openssl installed
+namespace aria2 {
+
+class ARC4Encryptor {
+public:
+  ARC4Encryptor() {}
+
+  ~ARC4Encryptor() {}
+
+  void init(const unsigned char* key, size_t keyLength) {}
+
+  void encrypt(unsigned char* out, size_t outLength,
+	       const unsigned char* in, size_t inLength) {}
+};
+
+} // namespace aria2
+
+#endif
 
 #endif // _D_ARC4_ENCRYPTOR_H_