path: root/src/eap_peer/eap_gpsk.c
diff options
authorJouni Malinen <j@w1.fi>2010-11-23 23:05:20 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-23 23:05:20 (GMT)
commit3642c4313a79f2eb44cb059f32217ed6eb0e20b6 (patch)
treeac96774256e1a6811f6f6bbdeb23a19fc930310b /src/eap_peer/eap_gpsk.c
parent1bdb7ab3af9b78414592808e8467bcb3e3d82e04 (diff)
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.
Diffstat (limited to 'src/eap_peer/eap_gpsk.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eap_peer/eap_gpsk.c b/src/eap_peer/eap_gpsk.c
index f6a1955..5037c60 100644
--- a/src/eap_peer/eap_gpsk.c
+++ b/src/eap_peer/eap_gpsk.c
@@ -15,6 +15,7 @@
#include "includes.h"
#include "common.h"
+#include "crypto/random.h"
#include "eap_peer/eap_i.h"
#include "eap_common/eap_gpsk_common.h"
@@ -326,7 +327,7 @@ static struct wpabuf * eap_gpsk_send_gpsk_2(struct eap_gpsk_data *data,
wpabuf_put_be16(resp, data->id_server_len);
wpabuf_put_data(resp, data->id_server, data->id_server_len);
- if (os_get_random(data->rand_peer, EAP_GPSK_RAND_LEN)) {
+ if (random_get_bytes(data->rand_peer, EAP_GPSK_RAND_LEN)) {
wpa_printf(MSG_DEBUG, "EAP-GPSK: Failed to get random data "
"for RAND_Peer");
eap_gpsk_state(data, FAILURE);