From a8598b0fafd0c62f0598f25913e99348f4a8bf32 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 5 Aug 2014 17:46:37 +0200 Subject: [PATCH] fix unregister_prng() where always the first prng would have been removed --- src/misc/crypt/crypt_unregister_prng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/crypt/crypt_unregister_prng.c b/src/misc/crypt/crypt_unregister_prng.c index bb34501..424131a 100644 --- a/src/misc/crypt/crypt_unregister_prng.c +++ b/src/misc/crypt/crypt_unregister_prng.c @@ -25,11 +25,11 @@ int unregister_prng(const struct ltc_prng_descriptor *prng) int x; LTC_ARGCHK(prng != NULL); - + /* is it already registered? */ LTC_MUTEX_LOCK(<c_prng_mutex); for (x = 0; x < TAB_SIZE; x++) { - if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) != 0) { + if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) == 0) { prng_descriptor[x].name = NULL; LTC_MUTEX_UNLOCK(<c_prng_mutex); return CRYPT_OK;