diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-06-08 16:28:15 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-07-01 08:16:40 +0200 |
commit | 9705671025eba34b70d73e9d4e78813e4f2d31da (patch) | |
tree | 8bd643348c44f9d19f6e719b6197f33f121aa9a5 /openbsc/include | |
parent | fce6971fe3673e8269414188fda0ce3b28b5cf03 (diff) |
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.
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/bsc_nat.h | 1 |
1 files changed, 1 insertions, 0 deletions
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; |