libhashkit/aes: make using openssl configurable
[awesomized/libmemcached] / src / libhashkit / encrypt.cc
index dbc051ae2d5e81c9f8b3f4d41763c274bf9adba2..e7898a6a3f6a08960ae4584c4e53a20f64b58e8f 100644 (file)
 
 #include "libhashkit/common.h"
 
-#ifdef WITH_OPENSSL
+#ifdef HAVE_OPENSSL_CRYPTO
 #  include <openssl/evp.h>
 #endif
 
 hashkit_string_st *hashkit_encrypt(hashkit_st *kit, const char *source, size_t source_length) {
-#ifdef WITH_OPENSSL
+#ifdef HAVE_OPENSSL_CRYPTO
   return aes_encrypt((encryption_context_t *) kit->_cryptographic_context,
                      (const unsigned char *) source, source_length);
 #else
@@ -30,7 +30,7 @@ hashkit_string_st *hashkit_encrypt(hashkit_st *kit, const char *source, size_t s
 }
 
 hashkit_string_st *hashkit_decrypt(hashkit_st *kit, const char *source, size_t source_length) {
-#ifdef WITH_OPENSSL
+#ifdef HAVE_OPENSSL_CRYPTO
   return aes_decrypt((encryption_context_t *) kit->_cryptographic_context,
                      (const unsigned char *) source, source_length);
 #else
@@ -38,7 +38,7 @@ hashkit_string_st *hashkit_decrypt(hashkit_st *kit, const char *source, size_t s
 #endif
 }
 
-#ifdef WITH_OPENSSL
+#ifdef HAVE_OPENSSL_CRYPTO
 bool hashkit_key(hashkit_st *kit, const char *key, const size_t key_length) {
   kit->_cryptographic_context = (encryption_context_t *) malloc(sizeof(encryption_context_t));
   ((encryption_context_t *) kit->_cryptographic_context)->encryption_context = EVP_CIPHER_CTX_new();
@@ -61,4 +61,4 @@ bool hashkit_key(hashkit_st *kit, const char *key, const size_t key_length) {
 
   return bool(kit->_cryptographic_context);
 }
-#endif
\ No newline at end of file
+#endif