Annotate places depending on strong random numbers
This commit adds a new wrapper, random_get_bytes(), that is currently defined to use os_get_random() as is. The places using random_get_bytes() depend on the returned value being strong random number, i.e., something that is infeasible for external device to figure out. These values are used either directly as a key or as nonces/challenges that are used as input for key derivation or authentication. The remaining direct uses of os_get_random() do not need as strong random numbers to function correctly.
This commit is contained in:
parent
1bdb7ab3af
commit
3642c4313a
38 changed files with 123 additions and 63 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "common.h"
|
||||
#include "crypto/ms_funcs.h"
|
||||
#include "crypto/random.h"
|
||||
#include "eap_i.h"
|
||||
|
||||
|
||||
|
@ -109,7 +110,7 @@ static struct wpabuf * eap_mschapv2_build_challenge(
|
|||
size_t ms_len;
|
||||
|
||||
if (!data->auth_challenge_from_tls &&
|
||||
os_get_random(data->auth_challenge, CHALLENGE_LEN)) {
|
||||
random_get_bytes(data->auth_challenge, CHALLENGE_LEN)) {
|
||||
wpa_printf(MSG_ERROR, "EAP-MSCHAPV2: Failed to get random "
|
||||
"data");
|
||||
data->state = FAILURE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue