fix unregister_prng() where always the first prng would have been removed
This commit is contained in:
parent
3cda802deb
commit
a8598b0faf
@ -25,11 +25,11 @@ int unregister_prng(const struct ltc_prng_descriptor *prng)
|
|||||||
int x;
|
int x;
|
||||||
|
|
||||||
LTC_ARGCHK(prng != NULL);
|
LTC_ARGCHK(prng != NULL);
|
||||||
|
|
||||||
/* is it already registered? */
|
/* is it already registered? */
|
||||||
LTC_MUTEX_LOCK(<c_prng_mutex);
|
LTC_MUTEX_LOCK(<c_prng_mutex);
|
||||||
for (x = 0; x < TAB_SIZE; x++) {
|
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;
|
prng_descriptor[x].name = NULL;
|
||||||
LTC_MUTEX_UNLOCK(<c_prng_mutex);
|
LTC_MUTEX_UNLOCK(<c_prng_mutex);
|
||||||
return CRYPT_OK;
|
return CRYPT_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user