mirror of
https://github.com/estkme-group/lpac
synced 2024-07-04 15:56:42 +02:00
make compiler (also devs) happy
This commit is contained in:
parent
0767033c71
commit
b917f6e57a
|
@ -39,7 +39,7 @@ int euicc_base64_decode_len(const char *bufcoded)
|
||||||
return nbytesdecoded + 1;
|
return nbytesdecoded + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int euicc_base64_decode(char *bufplain, const char *bufcoded)
|
int euicc_base64_decode(unsigned char *bufplain, const char *bufcoded)
|
||||||
{
|
{
|
||||||
int nbytesdecoded;
|
int nbytesdecoded;
|
||||||
register const unsigned char *bufin;
|
register const unsigned char *bufin;
|
||||||
|
@ -94,7 +94,7 @@ int euicc_base64_encode_len(int len)
|
||||||
return ((len + 2) / 3 * 4) + 1;
|
return ((len + 2) / 3 * 4) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int euicc_base64_encode(char *encoded, const char *string, int len)
|
int euicc_base64_encode(char *encoded, const unsigned char *string, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
int euicc_base64_decode_len(const char *bufcoded);
|
int euicc_base64_decode_len(const char *bufcoded);
|
||||||
int euicc_base64_decode(char *bufplain, const char *bufcoded);
|
int euicc_base64_decode(unsigned char *bufplain, const char *bufcoded);
|
||||||
int euicc_base64_encode_len(int len);
|
int euicc_base64_encode_len(int len);
|
||||||
int euicc_base64_encode(char *encoded, const char *string, int len);
|
int euicc_base64_encode(char *encoded, const unsigned char *string, int len);
|
||||||
|
|
|
@ -153,7 +153,7 @@ static int iter_SetDefaultDpAddressResponse(struct apdu_response *response, void
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
asn_INTEGER2ulong(&asn1resp->setDefaultDpAddressResult, eresult);
|
asn_INTEGER2long(&asn1resp->setDefaultDpAddressResult, eresult);
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
|
|
@ -62,7 +62,7 @@ int es10b_prepare_download(struct euicc_ctx *ctx, char **b64_response, struct es
|
||||||
|
|
||||||
memset(&sha256ctx, 0, sizeof(sha256ctx));
|
memset(&sha256ctx, 0, sizeof(sha256ctx));
|
||||||
euicc_sha256_init(&sha256ctx);
|
euicc_sha256_init(&sha256ctx);
|
||||||
euicc_sha256_update(&sha256ctx, param->str_checkcode, strlen(param->str_checkcode));
|
euicc_sha256_update(&sha256ctx, (uint8_t *)param->str_checkcode, strlen(param->str_checkcode));
|
||||||
euicc_sha256_final(&sha256ctx, hashCC);
|
euicc_sha256_final(&sha256ctx, hashCC);
|
||||||
|
|
||||||
memcpy(merged, hashCC, sizeof(hashCC));
|
memcpy(merged, hashCC, sizeof(hashCC));
|
||||||
|
@ -648,7 +648,7 @@ int es10b_retrieve_notification(struct euicc_ctx *ctx, char **b64_payload, char
|
||||||
RetrieveNotificationsListResponse_t *asn1resp = NULL;
|
RetrieveNotificationsListResponse_t *asn1resp = NULL;
|
||||||
PendingNotification_t *asn1notification;
|
PendingNotification_t *asn1notification;
|
||||||
NotificationMetadata_t *asn1metadata;
|
NotificationMetadata_t *asn1metadata;
|
||||||
char *payload = NULL;
|
uint8_t *payload = NULL;
|
||||||
unsigned payload_length = 0;
|
unsigned payload_length = 0;
|
||||||
|
|
||||||
*b64_payload = NULL;
|
*b64_payload = NULL;
|
||||||
|
@ -882,7 +882,7 @@ int es10b_authenticate_server(struct euicc_ctx *ctx, char **b64_response, struct
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
memset(ctx_params1->choice.ctxParamsForCommonAuthentication.deviceInfo.imei, 0, sizeof(Octet8_t));
|
memset(ctx_params1->choice.ctxParamsForCommonAuthentication.deviceInfo.imei, 0, sizeof(Octet8_t));
|
||||||
if (OCTET_STRING_fromBuf(ctx_params1->choice.ctxParamsForCommonAuthentication.deviceInfo.imei, binimei, binimei_len) < 0)
|
if (OCTET_STRING_fromBuf(ctx_params1->choice.ctxParamsForCommonAuthentication.deviceInfo.imei, (const char *)binimei, binimei_len) < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
@ -891,9 +891,9 @@ int es10b_authenticate_server(struct euicc_ctx *ctx, char **b64_response, struct
|
||||||
|
|
||||||
if (!param->tac)
|
if (!param->tac)
|
||||||
{
|
{
|
||||||
param->tac = "\x35\x29\x06\x11";
|
param->tac = (const unsigned char *)"\x35\x29\x06\x11";
|
||||||
}
|
}
|
||||||
if (OCTET_STRING_fromBuf(&ctx_params1->choice.ctxParamsForCommonAuthentication.deviceInfo.tac, param->tac, 4) < 0)
|
if (OCTET_STRING_fromBuf(&ctx_params1->choice.ctxParamsForCommonAuthentication.deviceInfo.tac, (const char *)param->tac, 4) < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct es10b_authenticate_server_param
|
||||||
const char *b64_server_certificate;
|
const char *b64_server_certificate;
|
||||||
const char *matchingId;
|
const char *matchingId;
|
||||||
const char *imei;
|
const char *imei;
|
||||||
const char *tac;
|
const unsigned char *tac;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum es10b_cancel_session_reason
|
enum es10b_cancel_session_reason
|
||||||
|
|
|
@ -254,7 +254,6 @@ int es10c_enable_profile_aid(struct euicc_ctx *ctx, const char *aid, int refresh
|
||||||
{
|
{
|
||||||
int fret = 0;
|
int fret = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int tRF;
|
|
||||||
asn_enc_rval_t asn1erval;
|
asn_enc_rval_t asn1erval;
|
||||||
EnableProfileRequest_t *asn1req = NULL;
|
EnableProfileRequest_t *asn1req = NULL;
|
||||||
uint8_t asn1aid[16];
|
uint8_t asn1aid[16];
|
||||||
|
@ -276,7 +275,7 @@ int es10c_enable_profile_aid(struct euicc_ctx *ctx, const char *aid, int refresh
|
||||||
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
||||||
|
|
||||||
asn1req->profileIdentifier.present = EnableProfileRequest__profileIdentifier_PR_isdpAid;
|
asn1req->profileIdentifier.present = EnableProfileRequest__profileIdentifier_PR_isdpAid;
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.isdpAid, asn1aid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.isdpAid, (const char *)asn1aid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -313,7 +312,6 @@ int es10c_enable_profile_iccid(struct euicc_ctx *ctx, const char *iccid, int ref
|
||||||
{
|
{
|
||||||
int fret = 0;
|
int fret = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int tRF;
|
|
||||||
asn_enc_rval_t asn1erval;
|
asn_enc_rval_t asn1erval;
|
||||||
EnableProfileRequest_t *asn1req = NULL;
|
EnableProfileRequest_t *asn1req = NULL;
|
||||||
uint8_t asn1iccid[20];
|
uint8_t asn1iccid[20];
|
||||||
|
@ -335,7 +333,7 @@ int es10c_enable_profile_iccid(struct euicc_ctx *ctx, const char *iccid, int ref
|
||||||
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
||||||
|
|
||||||
asn1req->profileIdentifier.present = EnableProfileRequest__profileIdentifier_PR_iccid;
|
asn1req->profileIdentifier.present = EnableProfileRequest__profileIdentifier_PR_iccid;
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.iccid, asn1iccid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.iccid, (const char *)asn1iccid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -398,7 +396,6 @@ int es10c_disable_profile_aid(struct euicc_ctx *ctx, const char *aid, int refres
|
||||||
{
|
{
|
||||||
int fret = 0;
|
int fret = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int tRF;
|
|
||||||
asn_enc_rval_t asn1erval;
|
asn_enc_rval_t asn1erval;
|
||||||
DisableProfileRequest_t *asn1req = NULL;
|
DisableProfileRequest_t *asn1req = NULL;
|
||||||
uint8_t asn1aid[16];
|
uint8_t asn1aid[16];
|
||||||
|
@ -420,7 +417,7 @@ int es10c_disable_profile_aid(struct euicc_ctx *ctx, const char *aid, int refres
|
||||||
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
||||||
|
|
||||||
asn1req->profileIdentifier.present = DisableProfileRequest__profileIdentifier_PR_isdpAid;
|
asn1req->profileIdentifier.present = DisableProfileRequest__profileIdentifier_PR_isdpAid;
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.isdpAid, asn1aid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.isdpAid, (const char *)asn1aid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -457,7 +454,6 @@ int es10c_disable_profile_iccid(struct euicc_ctx *ctx, const char *iccid, int re
|
||||||
{
|
{
|
||||||
int fret = 0;
|
int fret = 0;
|
||||||
int ret;
|
int ret;
|
||||||
int tRF;
|
|
||||||
asn_enc_rval_t asn1erval;
|
asn_enc_rval_t asn1erval;
|
||||||
DisableProfileRequest_t *asn1req = NULL;
|
DisableProfileRequest_t *asn1req = NULL;
|
||||||
uint8_t asn1iccid[20];
|
uint8_t asn1iccid[20];
|
||||||
|
@ -479,7 +475,7 @@ int es10c_disable_profile_iccid(struct euicc_ctx *ctx, const char *iccid, int re
|
||||||
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
asn1req->refreshFlag = (refreshflag == 0) ? 0 : 1;
|
||||||
|
|
||||||
asn1req->profileIdentifier.present = DisableProfileRequest__profileIdentifier_PR_iccid;
|
asn1req->profileIdentifier.present = DisableProfileRequest__profileIdentifier_PR_iccid;
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.iccid, asn1iccid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->profileIdentifier.choice.iccid, (const char *)asn1iccid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -561,7 +557,7 @@ int es10c_delete_profile_aid(struct euicc_ctx *ctx, const char *aid)
|
||||||
memset(asn1req, 0, sizeof(*asn1req));
|
memset(asn1req, 0, sizeof(*asn1req));
|
||||||
|
|
||||||
asn1req->present = DeleteProfileRequest_PR_isdpAid;
|
asn1req->present = DeleteProfileRequest_PR_isdpAid;
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->choice.isdpAid, asn1aid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->choice.isdpAid, (const char *)asn1aid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -617,7 +613,7 @@ int es10c_delete_profile_iccid(struct euicc_ctx *ctx, const char *iccid)
|
||||||
memset(asn1req, 0, sizeof(*asn1req));
|
memset(asn1req, 0, sizeof(*asn1req));
|
||||||
|
|
||||||
asn1req->present = DeleteProfileRequest_PR_iccid;
|
asn1req->present = DeleteProfileRequest_PR_iccid;
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->choice.iccid, asn1iccid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->choice.iccid, (const char *)asn1iccid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -879,7 +875,7 @@ int es10c_set_nickname(struct euicc_ctx *ctx, const char *iccid, const char *nic
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = OCTET_STRING_fromBuf(&asn1req->iccid, asn1iccid, ret);
|
ret = OCTET_STRING_fromBuf(&asn1req->iccid, (const char *)asn1iccid, ret);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define ISD_R_AID "\xA0\x00\x00\x05\x59\x10\x10\xFF\xFF\xFF\xFF\x89\x00\x00\x01\x00"
|
#define ISD_R_AID (const unsigned char *)"\xA0\x00\x00\x05\x59\x10\x10\xFF\xFF\xFF\xFF\x89\x00\x00\x01\x00"
|
||||||
|
|
||||||
#define APDU_EUICC_HEADER 0x80, 0xE2
|
#define APDU_EUICC_HEADER 0x80, 0xE2
|
||||||
#define APDU_CONTINUE_READ_HEADER 0x80, 0xC0, 0x00, 0x00
|
#define APDU_CONTINUE_READ_HEADER 0x80, 0xC0, 0x00, 0x00
|
||||||
|
|
|
@ -42,7 +42,7 @@ static int es9p_trans_ex(struct euicc_ctx *ctx, const char *url, const char *url
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[DEBUG] [HTTP] [TX] url: %s, data: %s\n", full_url, str_tx);
|
fprintf(stderr, "[DEBUG] [HTTP] [TX] url: %s, data: %s\n", full_url, str_tx);
|
||||||
}
|
}
|
||||||
if (ctx->interface.http->transmit(ctx, full_url, &rcode_mearged, &rbuf, &rlen, str_tx, strlen(str_tx), lpa_header) < 0)
|
if (ctx->interface.http->transmit(ctx, full_url, &rcode_mearged, &rbuf, &rlen, (const uint8_t *)str_tx, strlen(str_tx), lpa_header) < 0)
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int euicc_hexutil_bin2hex(char *output, unsigned output_len, const char *bin, int bin_len)
|
int euicc_hexutil_bin2hex(char *output, unsigned output_len, const unsigned char *bin, int bin_len)
|
||||||
{
|
{
|
||||||
const char hexDigits[] = "0123456789abcdef";
|
const char hexDigits[] = "0123456789abcdef";
|
||||||
|
|
||||||
|
@ -29,12 +29,12 @@ int euicc_hexutil_bin2hex(char *output, unsigned output_len, const char *bin, in
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int euicc_hexutil_hex2bin(char *output, unsigned output_len, const char *str)
|
int euicc_hexutil_hex2bin(unsigned char *output, unsigned output_len, const char *str)
|
||||||
{
|
{
|
||||||
return euicc_hexutil_hex2bin_r(output, output_len, str, strlen(str));
|
return euicc_hexutil_hex2bin_r(output, output_len, str, strlen(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
int euicc_hexutil_hex2bin_r(char *output, unsigned output_len, const char *str, unsigned str_len)
|
int euicc_hexutil_hex2bin_r(unsigned char *output, unsigned output_len, const char *str, unsigned str_len)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ int euicc_hexutil_hex2bin_r(char *output, unsigned output_len, const char *str,
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
int euicc_hexutil_gsmbcd2bin(char *output, unsigned output_len, const char *str)
|
int euicc_hexutil_gsmbcd2bin(unsigned char *output, unsigned output_len, const char *str)
|
||||||
{
|
{
|
||||||
unsigned str_length;
|
unsigned str_length;
|
||||||
unsigned idx = 0;
|
unsigned idx = 0;
|
||||||
|
@ -135,7 +135,7 @@ int euicc_hexutil_gsmbcd2bin(char *output, unsigned output_len, const char *str)
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
int euicc_hexutil_bin2gsmbcd(char *output, unsigned output_len, const char *binData, int length)
|
int euicc_hexutil_bin2gsmbcd(char *output, unsigned output_len, const unsigned char *binData, int length)
|
||||||
{
|
{
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
int euicc_hexutil_bin2hex(char *output, unsigned output_len, const char *binData, int length);
|
int euicc_hexutil_bin2hex(char *output, unsigned output_len, const unsigned char *binData, int length);
|
||||||
int euicc_hexutil_hex2bin(char *output, unsigned output_len, const char *hexStr);
|
int euicc_hexutil_hex2bin(unsigned char *output, unsigned output_len, const char *hexStr);
|
||||||
int euicc_hexutil_hex2bin_r(char *output, unsigned output_len, const char *str, unsigned str_len);
|
int euicc_hexutil_hex2bin_r(unsigned char *output, unsigned output_len, const char *str, unsigned str_len);
|
||||||
int euicc_hexutil_gsmbcd2bin(char *output, unsigned output_len, const char *str);
|
int euicc_hexutil_gsmbcd2bin(unsigned char *output, unsigned output_len, const char *str);
|
||||||
int euicc_hexutil_bin2gsmbcd(char *output, unsigned output_len, const char *binData, int length);
|
int euicc_hexutil_bin2gsmbcd(char *output, unsigned output_len, const unsigned char *binData, int length);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
static FILE *fuart;
|
static FILE *fuart;
|
||||||
static int logic_channel = 0;
|
static int logic_channel = 0;
|
||||||
|
|
||||||
static int hexutil_hex2bin(char *output, unsigned output_len, const char *str, unsigned str_len)
|
static int hexutil_hex2bin(unsigned char *output, unsigned output_len, const char *str, unsigned str_len)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ static int hexutil_hex2bin(char *output, unsigned output_len, const char *str, u
|
||||||
|
|
||||||
static int at_expect(char **response, const char *expected)
|
static int at_expect(char **response, const char *expected)
|
||||||
{
|
{
|
||||||
uint8_t buffer[1024];
|
char buffer[1024];
|
||||||
|
|
||||||
if (response)
|
if (response)
|
||||||
*response = NULL;
|
*response = NULL;
|
||||||
|
|
|
@ -12,6 +12,14 @@
|
||||||
#include <euicc/interface.h>
|
#include <euicc/interface.h>
|
||||||
|
|
||||||
/* BEGIN MINIMAL CURL DEFINE */
|
/* BEGIN MINIMAL CURL DEFINE */
|
||||||
|
#if defined(WIN32)
|
||||||
|
#define LIBCURL_DEFAULT_PATH "libcurl.dll"
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
#define LIBCURL_DEFAULT_PATH "libcurl.4.dylib"
|
||||||
|
#else
|
||||||
|
#define LIBCURL_DEFAULT_PATH "libcurl.so.4"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CURL_GLOBAL_DEFAULT ((1 << 0) | (1 << 1))
|
#define CURL_GLOBAL_DEFAULT ((1 << 0) | (1 << 1))
|
||||||
#define CURLE_OK 0
|
#define CURLE_OK 0
|
||||||
#define CURLOPT_URL 10002
|
#define CURLOPT_URL 10002
|
||||||
|
@ -145,15 +153,7 @@ EUICC_SHARED_EXPORT int libhttpinterface_init(struct euicc_http_interface *ifstr
|
||||||
|
|
||||||
if (!(libcurl_path = getenv("LIBCURL")))
|
if (!(libcurl_path = getenv("LIBCURL")))
|
||||||
{
|
{
|
||||||
#if defined(__MINGW32__)
|
libcurl_path = LIBCURL_DEFAULT_PATH;
|
||||||
libcurl_path = "libcurl.dll";
|
|
||||||
#elif defined(__CYGWIN__)
|
|
||||||
libcurl_path = "libcurl.dll";
|
|
||||||
#elif defined(__APPLE__)
|
|
||||||
libcurl_path = "libcurl.4.dylib";
|
|
||||||
#else
|
|
||||||
libcurl_path = "libcurl.so.4";
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(libcurl_interface_dlhandle = dlopen(libcurl_path, RTLD_LAZY)))
|
if (!(libcurl_interface_dlhandle = dlopen(libcurl_path, RTLD_LAZY)))
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <euicc/interface.h>
|
#include <euicc/interface.h>
|
||||||
|
|
||||||
static int hexutil_bin2hex(char *output, unsigned output_len, const char *bin, int bin_len)
|
static int hexutil_bin2hex(char *output, unsigned output_len, const unsigned char *bin, int bin_len)
|
||||||
{
|
{
|
||||||
const char hexDigits[] = "0123456789abcdef";
|
const char hexDigits[] = "0123456789abcdef";
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ static int hexutil_bin2hex(char *output, unsigned output_len, const char *bin, i
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hexutil_hex2bin(char *output, unsigned output_len, const char *str, unsigned str_len)
|
static int hexutil_hex2bin(unsigned char *output, unsigned output_len, const char *str, unsigned str_len)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__MINGW32__)
|
#if defined(WIN32)
|
||||||
#define INTERFACELIB_POSTFIX "dll"
|
#define INTERFACELIB_EXTENSION "dll"
|
||||||
#elif defined(__CYGWIN__)
|
|
||||||
#define INTERFACELIB_POSTFIX "dll"
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#define INTERFACELIB_POSTFIX "dylib"
|
#define INTERFACELIB_EXTENSION "dylib"
|
||||||
#else
|
#else
|
||||||
#define INTERFACELIB_POSTFIX "so"
|
#define INTERFACELIB_EXTENSION "so"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct applet_entry applet_apdu = {
|
static struct applet_entry applet_apdu = {
|
||||||
|
@ -52,12 +50,12 @@ static void dlsym_interfaces_get_path(void)
|
||||||
{
|
{
|
||||||
if (!(libapduinterface_path = getenv("APDU_INTERFACE")))
|
if (!(libapduinterface_path = getenv("APDU_INTERFACE")))
|
||||||
{
|
{
|
||||||
libapduinterface_path = "libapduinterface_pcsc." INTERFACELIB_POSTFIX;
|
libapduinterface_path = "libapduinterface_pcsc." INTERFACELIB_EXTENSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(libhttpinterface_path = getenv("HTTP_INTERFACE")))
|
if (!(libhttpinterface_path = getenv("HTTP_INTERFACE")))
|
||||||
{
|
{
|
||||||
libhttpinterface_path = "libhttpinterface_curl." INTERFACELIB_POSTFIX;
|
libhttpinterface_path = "libhttpinterface_curl." INTERFACELIB_EXTENSION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue