Fix checking error value
authorWonkyu Kwon <wonkyu.kwon@samsung.com>
Tue, 28 May 2013 06:23:32 +0000 (15:23 +0900)
committerWonkyu Kwon <wonkyu.kwon@samsung.com>
Wed, 24 Jul 2013 08:56:37 +0000 (17:56 +0900)
Change-Id: I0dd9c4c549f93284bbba2172ae884538dffb1938

common/EFDIR.cpp
common/PKCS15.cpp
common/PKCS15DODF.cpp
common/PKCS15ODF.cpp
server/ServerResource.cpp

index bc78a18..32b9e55 100644 (file)
@@ -34,7 +34,7 @@ namespace smartcard_service_api
                int ret;
 
                ret = select(dirPath, false);
-               if (ret == FileObject::SUCCESS)
+               if (ret >= SCARD_ERROR_OK)
                {
                        _DBG("response : %s", selectResponse.toString());
                }
index ce9729b..6b4d0c7 100644 (file)
@@ -36,7 +36,7 @@ namespace smartcard_service_api
                int ret;
 
                ret = select(PKCS15::PKCS15_AID);
-               if (ret == FileObject::SUCCESS)
+               if (ret >= SCARD_ERROR_OK)
                {
                        _DBG("response : %s", selectResponse.toString());
                }
@@ -85,7 +85,7 @@ namespace smartcard_service_api
                        int ret;
 
                        ret = select(path, false);
-                       if (ret == FileObject::SUCCESS)
+                       if (ret >= SCARD_ERROR_OK)
                        {
                                result = true;
                        }
index 12fad2f..e3d504f 100644 (file)
@@ -34,7 +34,7 @@ namespace smartcard_service_api
        {
                int ret = 0;
 
-               if ((ret = select(fid)) == 0)
+               if ((ret = select(fid)) >= SCARD_ERROR_OK)
                {
                        ByteArray dodfData, extra;
 
@@ -61,7 +61,7 @@ namespace smartcard_service_api
        {
                int ret = 0;
 
-               if ((ret = select(path)) == 0)
+               if ((ret = select(path)) >= SCARD_ERROR_OK)
                {
                        ByteArray dodfData, extra;
 
index 362634d..84c9590 100644 (file)
@@ -31,7 +31,7 @@ namespace smartcard_service_api
        {
                int ret = 0;
 
-               if ((ret = select(PKCS15ODF::ODF_FID)) == 0)
+               if ((ret = select(PKCS15ODF::ODF_FID)) >= SCARD_ERROR_OK)
                {
                        ByteArray odfData, extra;
 
index f1048bc..9365508 100644 (file)
@@ -400,6 +400,8 @@ namespace smartcard_service_api
                {
                        PKCS15 pkcs15(channel);
 
+                       channel->setSelectResponse(pkcs15.getSelectResponse());
+
                        acList->loadACL(channel);
                        result = acList->isAuthorizedAccess(aid, hashes);
                }
@@ -543,7 +545,7 @@ namespace smartcard_service_api
                                FileObject file(channel);
 
                                rv = file.select(aid);
-                               if (rv >= 0)
+                               if (rv >= SCARD_ERROR_OK)
                                {
                                        /* remove privilege mode */
                                        channel->unsetPrivilegeMode();