krb5 commit: Improve error message for PRNG seeding failure

Greg Hudson ghudson at MIT.EDU
Tue Jul 15 21:28:55 EDT 2014


https://github.com/krb5/krb5/commit/4f41a0d4a6a62439f21aacdd650595a065f15056
commit 4f41a0d4a6a62439f21aacdd650595a065f15056
Author: Greg Hudson <ghudson at mit.edu>
Date:   Tue Jul 15 20:23:15 2014 -0400

    Improve error message for PRNG seeding failure
    
    In prng_fortuna.c, if krb5_c_random_make_octets detects that we do not
    have entropy, set an error message saying that the random number
    generator could not be seeded, as we likely failed previously to read
    from /dev/urandom or the Windows equivalent.
    
    ticket: 7968 (new)

 src/lib/crypto/krb/prng_fortuna.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/lib/crypto/krb/prng_fortuna.c b/src/lib/crypto/krb/prng_fortuna.c
index 7a695a3..e70ffa3 100644
--- a/src/lib/crypto/krb/prng_fortuna.c
+++ b/src/lib/crypto/krb/prng_fortuna.c
@@ -423,6 +423,10 @@ krb5_c_random_make_octets(krb5_context context, krb5_data *outdata)
 
     if (!have_entropy) {
         k5_mutex_unlock(&fortuna_lock);
+        if (context != NULL) {
+            k5_set_error(&context->err, KRB5_CRYPTO_INTERNAL,
+                         _("Random number generator could not be seeded"));
+        }
         return KRB5_CRYPTO_INTERNAL;
     }
 


More information about the cvs-krb5 mailing list