{
_BEGIN();
- if (context == NULL || name == NULL ||
- strlen(name) == 0 || handle == NULL)
+ if (context == NULL || handle == NULL)
{
_ERR("invalid param");
GPOINTER_TO_UINT(handle),
(guint)id, var_aid, NULL,
&Session::session_open_channel_cb, param);
+
+ result = SCARD_ERROR_OK;
#else
Message msg;
}
Channel *Session::openBasicChannelSync(const ByteArray &aid)
- throw (ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+ throw (ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(0, aid);
}
Channel *Session::openBasicChannelSync(const unsigned char *aid, unsigned int length)
- throw (ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+ throw (ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &)
{
ByteArray temp(aid, length);
}
Channel *Session::openLogicalChannelSync(const ByteArray &aid)
- throw (ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+ throw (ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &)
{
return openChannelSync(1, aid);
}
Channel *Session::openLogicalChannelSync(const unsigned char *aid, unsigned int length)
- throw (ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &)
+ throw (ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &)
{
ByteArray temp(aid, length);
ErrorIllegalState &, ErrorIllegalParameter &);
Channel *openBasicChannelSync(const ByteArray &aid)
- throw(ErrorIO &, ErrorIllegalState &,
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
ErrorIllegalParameter &, ErrorSecurity &);
Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length)
- throw(ErrorIO &, ErrorIllegalState &,
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
ErrorIllegalParameter &, ErrorSecurity &);
Channel *openLogicalChannelSync(const ByteArray &aid)
- throw(ErrorIO &, ErrorIllegalState &,
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
ErrorIllegalParameter &, ErrorSecurity &);
Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length)
- throw(ErrorIO &, ErrorIllegalState &,
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
ErrorIllegalParameter &, ErrorSecurity &);
size_t getChannelCount() const;
{
SimpleTLV tlv(data);
+ if (rule == NULL) {
+ _ERR("invalid parameter");
+ return;
+ }
+
if (tlv.decodeTLV() == true)
{
switch (tlv.getTag())
static void loadNFCAccessRule(AccessRule *rule, const ByteArray &data)
{
+ if (rule == NULL) {
+ _ERR("invalid parameter");
+ return;
+ }
+
rule->setNFCAccessRule(SimpleTLV::getBoolean(data));
}
ErrorIllegalState &, ErrorIllegalParameter &) = 0;
virtual Channel *openBasicChannelSync(const ByteArray &aid)
- throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) = 0;
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &) = 0;
virtual Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length)
- throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) = 0;
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &) = 0;
virtual Channel *openLogicalChannelSync(const ByteArray &aid)
- throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) = 0;
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &) = 0;
virtual Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length)
- throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) = 0;
+ throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &,
+ ErrorIllegalParameter &, ErrorSecurity &) = 0;
};
} /* namespace smartcard_service_api */
const gchar *name, const gchar *old_owner,
const gchar *new_owner, void *user_data)
{
+ if (name == NULL || old_owner == NULL || new_owner == NULL) {
+ _ERR("invalid parameter");
+ return;
+ }
+
if (strlen(new_owner) == 0) {
ClientInstance *client;
resource.createClient(name, pid);
instance = resource.getClient(name);
-
- /* generate certification hashes */
- instance->generateCertificationHashes();
+ if (instance != NULL) {
+ /* generate certification hashes */
+ instance->generateCertificationHashes();
+ } else {
+ _ERR("createClient failed");
+ }
}
if (instance != NULL) {
addAccessControlList(channel, acl);
} else {
_ERR("unknown error, 0x%x", -ret);
+
delete acl;
+ acl = NULL;
}
} else {
_ERR("alloc failed");