From 9705671025eba34b70d73e9d4e78813e4f2d31da Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 8 Jun 2015 16:28:15 +0200 Subject: nat: Send 16 bytes of rand to the BSC and remember it Generate 16 byte of random data to be used for A3A8 by the BSC in the response. We can't know which BSC it is at this point and I don't want to send another message once the token has been received so always send the data with an undefined code. The old BSCs don't parse the message and will happily ignore the RAND. /dev/urandom can give short reads on Linux so loop around it until the bytes have been read from the kernel. --- openbsc/include/openbsc/bsc_nat.h | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc/include/openbsc/bsc_nat.h') diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 103593780..c313e5244 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -84,6 +84,7 @@ struct bsc_connection { /* do we know anything about this BSC? */ int authenticated; + uint8_t last_rand[16]; /* the fd we use to communicate */ struct osmo_wqueue write_queue; -- cgit v1.2.3