fix indent and simplify auth request packing

master
Andre Puschmann 7 years ago
parent 0c94974da6
commit a30ad8952c

@ -3792,8 +3792,8 @@ typedef struct{
}LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT; }LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT;
// Functions // Functions
LIBLTE_ERROR_ENUM liblte_mme_pack_esm_information_response_msg(LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp, LIBLTE_ERROR_ENUM liblte_mme_pack_esm_information_response_msg(LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp,
uint8 sec_hdr_type, uint8 sec_hdr_type,
uint32 count, uint32 count,
LIBLTE_BYTE_MSG_STRUCT *msg); LIBLTE_BYTE_MSG_STRUCT *msg);
LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg, LIBLTE_ERROR_ENUM liblte_mme_unpack_esm_information_response_msg(LIBLTE_BYTE_MSG_STRUCT *msg,
LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp); LIBLTE_MME_ESM_INFORMATION_RESPONSE_MSG_STRUCT *esm_info_resp);

@ -124,8 +124,8 @@ uint8_t security_128_eia2( uint8_t *key,
uint8_t *mac); uint8_t *mac);
uint8_t security_md5(const uint8_t *input, uint8_t security_md5(const uint8_t *input,
size_t len, size_t len,
uint8_t *output); uint8_t *output);
/****************************************************************************** /******************************************************************************

@ -1027,7 +1027,7 @@ LIBLTE_ERROR_ENUM liblte_mme_unpack_authentication_parameter_rand_ie(uint8 **ie_
Document Reference: 24.301 v10.2.0 Section 9.9.3.4 Document Reference: 24.301 v10.2.0 Section 9.9.3.4
*********************************************************************/ *********************************************************************/
LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_parameter_ie(uint8 *res, LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_parameter_ie(uint8 *res,
int res_len, int res_len,
uint8 **ie_ptr) uint8 **ie_ptr)
{ {
LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS; LIBLTE_ERROR_ENUM err = LIBLTE_ERROR_INVALID_INPUTS;
@ -1037,11 +1037,12 @@ LIBLTE_ERROR_ENUM liblte_mme_pack_authentication_response_parameter_ie(uint8 *r
ie_ptr != NULL) ie_ptr != NULL)
{ {
(*ie_ptr)[0] = res_len; (*ie_ptr)[0] = res_len;
*ie_ptr += 1;
for(i=0; i<res_len; i++) for(i=0; i<res_len; i++)
{ {
(*ie_ptr)[i+1] = res[i]; (*ie_ptr)[i] = res[i];
} }
*ie_ptr += res_len+1; *ie_ptr += res_len;
err = LIBLTE_SUCCESS; err = LIBLTE_SUCCESS;
} }

@ -40,14 +40,14 @@ namespace srsue {
#define AKA_RAND_LEN 16 #define AKA_RAND_LEN 16
#define AKA_AUTN_LEN 16 #define AKA_AUTN_LEN 16
#define AKA_AUTS_LEN 14 #define AKA_AUTS_LEN 14
#define RES_MAX_LEN 16 #define RES_MAX_LEN 16
#define MAC_LEN 8 #define MAC_LEN 8
#define IK_LEN 16 #define IK_LEN 16
#define CK_LEN 16 #define CK_LEN 16
#define AK_LEN 6 #define AK_LEN 6
#define SQN_LEN 6 #define SQN_LEN 6
#define KEY_LEN 32 #define KEY_LEN 32
typedef enum { typedef enum {
SCARD_GSM_SIM, SCARD_GSM_SIM,
@ -203,36 +203,36 @@ private:
*/ */
/* GSM SIM commands */ /* GSM SIM commands */
#define SIM_CMD_SELECT 0xa0, 0xa4, 0x00, 0x00, 0x02 #define SIM_CMD_SELECT 0xa0, 0xa4, 0x00, 0x00, 0x02
#define SIM_CMD_RUN_GSM_ALG 0xa0, 0x88, 0x00, 0x00, 0x10 #define SIM_CMD_RUN_GSM_ALG 0xa0, 0x88, 0x00, 0x00, 0x10
#define SIM_CMD_GET_RESPONSE 0xa0, 0xc0, 0x00, 0x00 #define SIM_CMD_GET_RESPONSE 0xa0, 0xc0, 0x00, 0x00
#define SIM_CMD_READ_BIN 0xa0, 0xb0, 0x00, 0x00 #define SIM_CMD_READ_BIN 0xa0, 0xb0, 0x00, 0x00
#define SIM_CMD_READ_RECORD 0xa0, 0xb2, 0x00, 0x00 #define SIM_CMD_READ_RECORD 0xa0, 0xb2, 0x00, 0x00
#define SIM_CMD_VERIFY_CHV1 0xa0, 0x20, 0x00, 0x01, 0x08 #define SIM_CMD_VERIFY_CHV1 0xa0, 0x20, 0x00, 0x01, 0x08
/* USIM commands */ /* USIM commands */
#define USIM_CLA 0x00 #define USIM_CLA 0x00
#define USIM_CMD_RUN_UMTS_ALG 0x00, 0x88, 0x00, 0x81, 0x22 #define USIM_CMD_RUN_UMTS_ALG 0x00, 0x88, 0x00, 0x81, 0x22
#define USIM_CMD_GET_RESPONSE 0x00, 0xc0, 0x00, 0x00 #define USIM_CMD_GET_RESPONSE 0x00, 0xc0, 0x00, 0x00
#define SIM_RECORD_MODE_ABSOLUTE 0x04 #define SIM_RECORD_MODE_ABSOLUTE 0x04
#define USIM_FSP_TEMPL_TAG 0x62 #define USIM_FSP_TEMPL_TAG 0x62
#define USIM_TLV_FILE_DESC 0x82 #define USIM_TLV_FILE_DESC 0x82
#define USIM_TLV_FILE_ID 0x83 #define USIM_TLV_FILE_ID 0x83
#define USIM_TLV_DF_NAME 0x84 #define USIM_TLV_DF_NAME 0x84
#define USIM_TLV_PROPR_INFO 0xA5 #define USIM_TLV_PROPR_INFO 0xA5
#define USIM_TLV_LIFE_CYCLE_STATUS 0x8A #define USIM_TLV_LIFE_CYCLE_STATUS 0x8A
#define USIM_TLV_FILE_SIZE 0x80 #define USIM_TLV_FILE_SIZE 0x80
#define USIM_TLV_TOTAL_FILE_SIZE 0x81 #define USIM_TLV_TOTAL_FILE_SIZE 0x81
#define USIM_TLV_PIN_STATUS_TEMPLATE 0xC6 #define USIM_TLV_PIN_STATUS_TEMPLATE 0xC6
#define USIM_TLV_SHORT_FILE_ID 0x88 #define USIM_TLV_SHORT_FILE_ID 0x88
#define USIM_TLV_SECURITY_ATTR_8B 0x8B #define USIM_TLV_SECURITY_ATTR_8B 0x8B
#define USIM_TLV_SECURITY_ATTR_8C 0x8C #define USIM_TLV_SECURITY_ATTR_8C 0x8C
#define USIM_TLV_SECURITY_ATTR_AB 0xAB #define USIM_TLV_SECURITY_ATTR_AB 0xAB
#define USIM_PS_DO_TAG 0x90 #define USIM_PS_DO_TAG 0x90
/* GSM files /* GSM files
* File type in first octet: * File type in first octet:
@ -241,18 +241,18 @@ private:
* 2F = Elementary File under the Master File * 2F = Elementary File under the Master File
* 6F = Elementary File under a Dedicated File * 6F = Elementary File under a Dedicated File
*/ */
#define SCARD_FILE_MF 0x3F00 #define SCARD_FILE_MF 0x3F00
#define SCARD_FILE_GSM_DF 0x7F20 #define SCARD_FILE_GSM_DF 0x7F20
#define SCARD_FILE_UMTS_DF 0x7F50 #define SCARD_FILE_UMTS_DF 0x7F50
#define SCARD_FILE_GSM_EF_IMSI 0x6F07 #define SCARD_FILE_GSM_EF_IMSI 0x6F07
#define SCARD_FILE_GSM_EF_AD 0x6FAD #define SCARD_FILE_GSM_EF_AD 0x6FAD
#define SCARD_FILE_EF_DIR 0x2F00 #define SCARD_FILE_EF_DIR 0x2F00
#define SCARD_FILE_EF_ICCID 0x2FE2 #define SCARD_FILE_EF_ICCID 0x2FE2
#define SCARD_FILE_EF_CK 0x6FE1 #define SCARD_FILE_EF_CK 0x6FE1
#define SCARD_FILE_EF_IK 0x6FE2 #define SCARD_FILE_EF_IK 0x6FE2
#define SCARD_CHV1_OFFSET 13 #define SCARD_CHV1_OFFSET 13
#define SCARD_CHV1_FLAG 0x80 #define SCARD_CHV1_FLAG 0x80
SCARDCONTEXT scard_context; SCARDCONTEXT scard_context;
SCARDHANDLE scard_handle; SCARDHANDLE scard_handle;

@ -23,8 +23,8 @@ target_link_libraries(usim_test srsue_upper srslte_upper srslte_phy)
add_test(usim_test usim_test) add_test(usim_test usim_test)
if(HAVE_PCSC) if(HAVE_PCSC)
add_executable(pcsc_usim_test pcsc_usim_test.cc) add_executable(pcsc_usim_test pcsc_usim_test.cc)
target_link_libraries(pcsc_usim_test srsue_upper srslte_upper srslte_phy) target_link_libraries(pcsc_usim_test srsue_upper srslte_upper srslte_phy)
endif(HAVE_PCSC) endif(HAVE_PCSC)
add_executable(rrc_reconfig_test rrc_reconfig_test.cc) add_executable(rrc_reconfig_test rrc_reconfig_test.cc)

@ -26,7 +26,7 @@
#include <iostream> #include <iostream>
#include <assert.h> #include <assert.h>
#include <srsue/hdr/upper/usim_base.h> #include "srsue/hdr/upper/usim_base.h"
#include "srsue/hdr/upper/usim.h" #include "srsue/hdr/upper/usim.h"
#include "srsue/hdr/upper/nas.h" #include "srsue/hdr/upper/nas.h"
#include "srslte/upper/rlc.h" #include "srslte/upper/rlc.h"

Loading…
Cancel
Save