b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /****************************************************************************** |
| 2 | *(C) Copyright 2018 ASR Microelectronics |
| 3 | * All Rights Reserved |
| 4 | ******************************************************************************/ |
| 5 | /* ---------------------------------------------------------------------------- |
| 6 | * |
| 7 | * Filename: mbim_auth.h |
| 8 | * |
| 9 | * |
| 10 | * Description: all auth mbim related functions should be added here |
| 11 | * |
| 12 | * |
| 13 | * Notes: |
| 14 | * |
| 15 | ******************************************************************************/ |
| 16 | #ifndef MBIM_AUTH_H |
| 17 | #define MBIM_AUTH_H |
| 18 | |
| 19 | /****************************************************************************** |
| 20 | * Include files |
| 21 | ******************************************************************************/ |
| 22 | #include <stdlib.h> |
| 23 | |
| 24 | #include "mbim_types.h" |
| 25 | #include "mbim_protocol.h" |
| 26 | |
| 27 | /****************************************************************************** |
| 28 | * Macros |
| 29 | ******************************************************************************/ |
| 30 | |
| 31 | |
| 32 | /****************************************************************************** |
| 33 | * Defines |
| 34 | ******************************************************************************/ |
| 35 | #define AUTH_CID_PARAMS UINT32 cid, UINT32 transactionId, UINT32 commandType, UINT32 infoBufLen, char *infoBuf_p |
| 36 | #define AUTH_CID_PARAMS_USAGE cid, transactionId, commandType, infoBufLen, infoBuf_p |
| 37 | |
| 38 | typedef int (*authUuidProcessors)(AUTH_CID_PARAMS); |
| 39 | |
| 40 | /****************************************************************************** |
| 41 | * External variables |
| 42 | ******************************************************************************/ |
| 43 | |
| 44 | |
| 45 | /****************************************************************************** |
| 46 | * MBIM_CID_AKA_AUTH (Chapter 10.5.31) |
| 47 | ******************************************************************************/ |
| 48 | typedef struct _MBIM_AKA_AUTH_REQ |
| 49 | { |
| 50 | UINT8 Rand[16]; |
| 51 | UINT8 Autn[16]; |
| 52 | }MBIM_AKA_AUTH_REQ, *P_MBIM_AKA_AUTH_REQ; |
| 53 | |
| 54 | typedef struct _MBIM_AKA_AUTH_INFO |
| 55 | { |
| 56 | UINT8 Res[16]; |
| 57 | UINT32 ResLen; |
| 58 | UINT8 IK[16]; |
| 59 | UINT8 CK[16]; |
| 60 | UINT8 Auts[14]; |
| 61 | }MBIM_AKA_AUTH_INFO, *P_MBIM_AKA_AUTH_INFO; |
| 62 | |
| 63 | /****************************************************************************** |
| 64 | * MBIM_CID_AKAP_AUTH (Chapter 10.5.32) |
| 65 | ******************************************************************************/ |
| 66 | typedef struct _MBIM_AKAP_AUTH_REQ |
| 67 | { |
| 68 | UINT8 Rand[16]; |
| 69 | UINT8 Autn[16]; |
| 70 | UINT32 NetworkNameOffset; |
| 71 | UINT32 NetworkNameLength; |
| 72 | char *DataBuffer; |
| 73 | }MBIM_AKAP_AUTH_REQ, *P_MBIM_AKAP_AUTH_REQ; |
| 74 | |
| 75 | typedef struct _MBIM_AKAP_AUTH_INFO |
| 76 | { |
| 77 | UINT8 Res[16]; |
| 78 | UINT32 ResLen; |
| 79 | UINT8 IK[16]; |
| 80 | UINT8 CK[16]; |
| 81 | UINT8 Auts[14]; |
| 82 | }MBIM_AKAP_AUTH_INFO, *P_MBIM_AKAP_AUTH_INFO; |
| 83 | |
| 84 | |
| 85 | /****************************************************************************** |
| 86 | * MBIM_CID_SIM_AUTH (Chapter 10.5.33) |
| 87 | ******************************************************************************/ |
| 88 | typedef struct _MBIM_SIM_AUTH_REQ |
| 89 | { |
| 90 | UINT8 Rand1[16]; |
| 91 | UINT8 Rand2[16]; |
| 92 | UINT8 Rand3[16]; |
| 93 | UINT32 n; |
| 94 | }MBIM_SIM_AUTH_REQ, *P_MBIM_SIM_AUTH_REQ; |
| 95 | |
| 96 | typedef struct _MBIM_SIM_AUTH_INFO |
| 97 | { |
| 98 | UINT8 Sres1[4]; |
| 99 | UINT8 Kc1[8]; |
| 100 | UINT8 Sres2[4]; |
| 101 | UINT8 Kc2[8]; |
| 102 | UINT8 Sres3[4]; |
| 103 | UINT8 Kc3[8]; |
| 104 | UINT32 n; |
| 105 | }MBIM_SIM_AUTH_INFO, *P_MBIM_SIM_AUTH_INFO; |
| 106 | |
| 107 | #endif |