Use fr_rand() instead of random(). It's stronger.
authorAlan T. DeKok <aland@freeradius.org>
Mon, 1 Sep 2014 14:39:11 +0000 (10:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 1 Sep 2014 14:39:11 +0000 (10:39 -0400)
src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c

index ecaeb70..18f3195 100644 (file)
@@ -248,7 +248,7 @@ static int eap_pwd_initiate (void *instance, eap_handler_t *handler)
        pack->group_num = htons(pwd_session->group_num);
        pack->random_function = EAP_PWD_DEF_RAND_FUN;
        pack->prf = EAP_PWD_DEF_PRF;
-       pwd_session->token = random();
+       pwd_session->token = fr_rand();
        memcpy(pack->token, (char *)&pwd_session->token, 4);
        pack->prep = EAP_PWD_PREP_NONE;
        strcpy(pack->identity, inst->conf->server_id);