Check rng return value when generating radius message authenticator
authorMartin Willi <martin@revosec.ch>
Fri, 6 Jul 2012 11:52:30 +0000 (13:52 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 16 Jul 2012 12:53:37 +0000 (14:53 +0200)
src/libradius/radius_message.c

index a09729c..23f549c 100644 (file)
@@ -293,7 +293,10 @@ METHOD(radius_message_t, sign, bool,
        if (rng)
        {
                /* build Request-Authenticator */
-               rng->get_bytes(rng, HASH_SIZE_MD5, this->msg->authenticator);
+               if (!rng->get_bytes(rng, HASH_SIZE_MD5, this->msg->authenticator))
+               {
+                       return FALSE;
+               }
        }
        else
        {