From bc2a23e0e7454fcba9770644055ac4d048db61e5 Mon Sep 17 00:00:00 2001 From: Vasil Velichkov Date: Tue, 27 Mar 2018 02:37:49 +0300 Subject: Check the gsm0503_xcch_decode return value - Discard the message when gsm0503_xcch_decode returns -1 - Add automated decrypt test See https://groups.google.com/d/msg/gr-gsm/9nOkIdrGOck/qTZh47McCQAJ --- lib/decoding/control_channels_decoder_impl.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/decoding/control_channels_decoder_impl.cc') diff --git a/lib/decoding/control_channels_decoder_impl.cc b/lib/decoding/control_channels_decoder_impl.cc index a6abaa3..bf0d976 100644 --- a/lib/decoding/control_channels_decoder_impl.cc +++ b/lib/decoding/control_channels_decoder_impl.cc @@ -105,7 +105,11 @@ namespace gr { //convert to soft bits ubits2sbits(bursts_u, bursts_s, 116 * 4); //decode - gsm0503_xcch_decode(result, bursts_s, &n_errors, &n_bits_total); + if (-1 == gsm0503_xcch_decode(result, bursts_s, &n_errors, &n_bits_total)) + { + //Possibly an encrypted message + return; + } //extract header of the first burst of the four bursts pmt::pmt_t first_header_plus_burst = pmt::cdr(d_bursts[0]); -- cgit v1.2.3