Blob Blame History Raw
From b6d992d0f96f2ecd9c0a3975576e4204c66b1fc6 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Thu, 11 Dec 2014 10:15:54 +0100
Subject: [PATCH] Allow a random generator with the same priority to
 re-register

That corrects an issue where the library is deinitialized, and
reinitialization wouldn't register the same rnd module.
Reported by Stanislav Zidek.
---
 lib/crypto-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/crypto-backend.c b/lib/crypto-backend.c
index 8840b1c..2132b53 100644
--- a/lib/crypto-backend.c
+++ b/lib/crypto-backend.c
@@ -193,7 +193,7 @@ const gnutls_crypto_cipher_st
 int
 gnutls_crypto_rnd_register(int priority, const gnutls_crypto_rnd_st * s)
 {
-	if (crypto_rnd_prio > priority) {
+	if (crypto_rnd_prio >= priority) {
 		memcpy(&_gnutls_rnd_ops, s, sizeof(*s));
 		crypto_rnd_prio = priority;
 		return 0;
-- 
1.9.3