/* SLP library header */
/* local header */
-#include "Debug.h"
+#include "smartcard_debug.h"
#include "Session.h"
#include "Reader.h"
#include "ClientChannel.h"
#include "ClientGDBus.h"
+/* LCOV_EXCL_START */
+
#ifndef EXTERN_API
#define EXTERN_API __attribute__((visibility("default")))
#endif
NULL, &error);
if (proxy == NULL)
{
- _ERR("Can not create proxy : %s", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("Can not create proxy : %s", error->message);
+ g_error_free(error);
+ }
return;
}
channels.clear();
}
- void Session::closeChannels() throw(ErrorIO &, ErrorIllegalState &)
+ void Session::closeChannels()
{
size_t i;
_ERR("smartcard_service_session_call_get_atr failed, [%d]", result);
}
} else {
- _ERR("smartcard_service_session_call_get_atr failed, [%s]", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("smartcard_service_session_call_get_atr failed, [%s]", error->message);
+ g_error_free(error);
+ }
result = SCARD_ERROR_IPC_FAILED;
}
var_response, response);
/* create new instance of channel */
- channel = new ClientChannel(session->context,
+ channel = new (std::nothrow)ClientChannel(session->context,
session, channel_id,
response, GUINT_TO_POINTER(channel_id));
if (channel != NULL) {
_ERR("smartcard_service_session_call_open_channel failed, [%d]", result);
}
} else {
- _ERR("smartcard_service_session_call_open_channel failed, [%s]", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("smartcard_service_session_call_open_channel failed, [%s]", error->message);
+ g_error_free(error);
+ }
result = SCARD_ERROR_IPC_FAILED;
}
_ERR("smartcard_service_session_call_close_session failed, [%d]", result);
}
} else {
- _ERR("smartcard_service_session_call_close_session failed, [%s]", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("smartcard_service_session_call_close_session failed, [%s]", error->message);
+ g_error_free(error);
+ }
result = SCARD_ERROR_IPC_FAILED;
}
}
const ByteArray Session::getATRSync()
- throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
- ErrorIllegalState &, ErrorIllegalParameter &)
{
ByteArray result;
THROW_ERROR(ret);
}
} else {
- _ERR("smartcard_service_session_call_get_atr_sync failed, [%s]", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("smartcard_service_session_call_get_atr_sync failed, [%s]", error->message);
+ g_error_free(error);
+ }
THROW_ERROR(SCARD_ERROR_IPC_FAILED);
}
if (getReader()->isSecureElementPresent() == true) {
if (atr.isEmpty() == true) {
- CallbackParam *param = new CallbackParam();
+ CallbackParam *param = new (std::nothrow)CallbackParam();
param->instance = this;
param->callback = (void *)callback;
}
void Session::closeSync()
- throw(ExceptionBase &, ErrorIO &, ErrorSecurity &,
- ErrorIllegalState &, ErrorIllegalParameter &)
{
if (isClosed() == false)
{
THROW_ERROR(ret);
}
} else {
- _ERR("smartcard_service_session_call_get_atr_sync failed, [%s]", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("smartcard_service_session_call_get_atr_sync failed, [%s]", error->message);
+ g_error_free(error);
+ }
THROW_ERROR(SCARD_ERROR_IPC_FAILED);
}
closed = true;
closeChannels();
- CallbackParam *param = new CallbackParam();
+ CallbackParam *param = new (std::nothrow)CallbackParam();
param->instance = this;
param->callback = (void *)callback;
return count;
}
Channel *Session::openChannelSync(int id, const ByteArray &aid)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(id, aid, 0x00);
}
Channel *Session::openChannelSync(int id, const ByteArray &aid, unsigned char P2)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
Channel *channel = NULL;
var_response, response);
/* create new instance of channel */
- channel = new ClientChannel(context,
+ channel = new (std::nothrow)ClientChannel(context,
this, channel_number,
response, GUINT_TO_POINTER(channel_id));
if (channel != NULL) {
THROW_ERROR(ret);
}
} else {
- _ERR("smartcard_service_session_call_open_channel_sync failed, [%s]", error->message);
- g_error_free(error);
+ if (error != NULL) {
+ _ERR("smartcard_service_session_call_open_channel_sync failed, [%s]", error->message);
+ g_error_free(error);
+ }
THROW_ERROR(SCARD_ERROR_IPC_FAILED);
}
if (getReader()->isSecureElementPresent() == true) {
GVariant *var_aid;
- CallbackParam *param = new CallbackParam();
+ CallbackParam *param = new (std::nothrow)CallbackParam();
param->instance = this;
param->callback = (void *)callback;
}
Channel *Session::openBasicChannelSync(const ByteArray &aid)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(0, aid, 0x00);
}
Channel *Session::openBasicChannelSync(const ByteArray &aid, unsigned char P2)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(0, aid, P2);
}
Channel *Session::openBasicChannelSync(const unsigned char *aid, unsigned int length)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
ByteArray temp(aid, length);
}
Channel *Session::openBasicChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
ByteArray temp(aid, length);
}
Channel *Session::openLogicalChannelSync(const ByteArray &aid)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(1, aid, 0x00);
}
Channel *Session::openLogicalChannelSync(const ByteArray &aid, unsigned char P2)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(1, aid, P2);
}
Channel *Session::openLogicalChannelSync(const unsigned char *aid, unsigned int length)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
ByteArray temp(aid, length);
}
Channel *Session::openLogicalChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2)
- throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
- ErrorIllegalParameter &, ErrorSecurity &)
{
ByteArray temp(aid, length);
{
}
+/* LCOV_EXCL_STOP */
+