From 4b7dcfe66dc68b4e49d8ec4ecde39d8daea1321f Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 18 Aug 2022 23:28:41 +0700 Subject: [PATCH] Fix handling of Re-Synchronization-Info AVP in AIR Below is an example of a decoded Requested-EUTRAN-Authentication-Info: [{ 'Requested-EUTRAN-Authentication-Info', [1], %% Number-Of-Requested-Vectors [1], %% Immediate-Response-Preferred [[ %% Re-Synchronization-Info 154,153,78,226,63,248,178,208,169,186,215,18,159,150,252, 103,249,220,169,90,223,249,219,26,172,118,171,193,216,221 ]], [] %% AVP }] As can be seen, the value of Re-Synchronization-Info is not a binary, but a list, so indeed is_binary(ReSyncInfo) would yeild false. Use is_list() instead and convert to binary using list_to_binary(). Change-Id: Ie5eded2f5fb2de01f69d2a9c0e5d70283bf5cbf5 Related: OS#5646 --- src/server_cb.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server_cb.erl b/src/server_cb.erl index dc7fe59..9893cb3 100644 --- a/src/server_cb.erl +++ b/src/server_cb.erl @@ -189,10 +189,11 @@ handle_request(#diameter_packet{msg = Req, errors = []}, _SvcName, {_, Caps}) wh GsupTx1 = #{message_type => send_auth_info_req, imsi => list_to_binary(UserName), supported_rat_types => [rat_eutran_sgs], current_rat_type => rat_eutran_sgs}, case ReqEU of - #'Requested-EUTRAN-Authentication-Info'{'Re-Synchronization-Info' = ReSyncInfo} - when is_binary(ReSyncInfo) -> - GsupTx2 = #{rand => string:substr(ReSyncInfo, 1, 16), - auts => string:substr(ReSyncInfo, 17)}; + #'Requested-EUTRAN-Authentication-Info'{'Re-Synchronization-Info' = [ReSyncInfo]} + when is_list(ReSyncInfo) -> + ReSyncInfoBin = list_to_binary(ReSyncInfo), + GsupTx2 = #{rand => string:substr(ReSyncInfoBin, 1, 16), + auts => string:substr(ReSyncInfoBin, 17)}; _ -> GsupTx2 = #{} end,