X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibhashkit%2Fhashkit.cc;fp=src%2Flibhashkit%2Fhashkit.cc;h=63b7f62edc5897b5f320314ac497369ccf54bb6d;hb=72df8af3b9cc00f590afa31371be571c1169a268;hp=e61b014d9a2583f562510cd25be0855c784c4039;hpb=c8300fc7f692c617f1a583a9cb22732a840e7d3e;p=awesomized%2Flibmemcached diff --git a/src/libhashkit/hashkit.cc b/src/libhashkit/hashkit.cc index e61b014d..63b7f62e 100644 --- a/src/libhashkit/hashkit.cc +++ b/src/libhashkit/hashkit.cc @@ -15,10 +15,6 @@ #include "libhashkit/common.h" -#ifdef HAVE_OPENSSL_CRYPTO -# include -#endif - static inline void _hashkit_init(hashkit_st *self) { self->base_hash.function = hashkit_one_at_a_time; self->base_hash.context = NULL; @@ -56,26 +52,11 @@ hashkit_st *hashkit_create(hashkit_st *self) { return self; } -#ifdef HAVE_OPENSSL_CRYPTO -static void cryptographic_context_free(encryption_context_t *context) { - EVP_CIPHER_CTX_free(context->encryption_context); - EVP_CIPHER_CTX_free(context->decryption_context); - free(context); -} -#endif - void hashkit_free(hashkit_st *self) { -#ifdef HAVE_OPENSSL_CRYPTO if (self and self->_key) { - cryptographic_context_free((encryption_context_t *)self->_key); + aes_free_key((aes_key_t *) self->_key); self->_key = NULL; } -#else - if (self and self->_key) { - free(self->_key); - self->_key = NULL; - } -#endif if (hashkit_is_allocated(self)) { free(self); @@ -98,21 +79,7 @@ hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *source) { destination->base_hash = source->base_hash; destination->distribution_hash = source->distribution_hash; destination->flags = source->flags; -#ifdef HAVE_OPENSSL_CRYPTO - if (destination->_key) { - cryptographic_context_free((encryption_context_t *)destination->_key); - destination->_key = NULL; - } - if (source->_key) { - destination->_key = - aes_clone_cryptographic_context(((encryption_context_t *) source->_key)); - if (destination->_key) { - - } - } -#else - destination->_key = aes_clone_key(static_cast(source->_key)); -#endif + destination->_key = aes_clone_key((aes_key_t *) source->_key); return destination; }