]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Allow a random generator with the same priority to re-register
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 11 Dec 2014 09:15:54 +0000 (10:15 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 11 Dec 2014 09:17:03 +0000 (10:17 +0100)
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

index 8840b1c1237a53627c16bd44ef69f0cac2bc6d51..2132b5334e47cc6a36ecc7c7bba6416b2aad57fd 100644 (file)
@@ -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;