File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 22
33## General
44
5+ * ` LPAC_CUSTOM_ISD_R_AID ` : specify which AID will be used to open the logic channel. (hex string, 32 chars)
56* ` LPAC_APDU ` : specify which APDU backend will be used. Values:
67 - ` at ` : use AT commands interface used by LTE module
78 - ` pcsc ` : use PC/SC Smart Card API
Original file line number Diff line number Diff line change 66#include <time.h>
77
88#include <euicc/interface.h>
9+ #include <euicc/hexutil.h>
910#include <euicc/euicc.h>
1011#include <driver.h>
1112
2324#include <processenv.h>
2425#endif
2526
27+ #define ISD_R_AID_STR_LENGTH 16
28+
2629static int driver_applet_main (int argc , char * * argv )
2730{
2831 const struct applet_entry * applets [] = {
@@ -58,6 +61,21 @@ struct euicc_ctx euicc_ctx = {0};
5861
5962void main_init_euicc ()
6063{
64+ const char * custom_aid_str = getenv ("LPAC_CUSTOM_ISD_R_AID" );
65+ if (custom_aid_str )
66+ {
67+ unsigned char custom_aid [ISD_R_AID_STR_LENGTH ];
68+ const int custom_aid_len = euicc_hexutil_hex2bin (custom_aid , ISD_R_AID_STR_LENGTH , custom_aid_str );
69+ if (custom_aid_len != ISD_R_AID_STR_LENGTH )
70+ {
71+ jprint_error ("euicc_init" , "invalid custom AID given" );
72+ exit (-1 );
73+ }
74+
75+ euicc_ctx .aid = custom_aid ;
76+ euicc_ctx .aid_len = custom_aid_len ;
77+ }
78+
6179 if (euicc_init (& euicc_ctx ))
6280 {
6381 jprint_error ("euicc_init" , NULL );
You can’t perform that action at this time.
0 commit comments