Fix to store the select response
authorWonkyu Kwon <wonkyu.kwon@samsung.com>
Wed, 22 May 2013 10:38:48 +0000 (19:38 +0900)
committerWonkyu Kwon <wonkyu.kwon@samsung.com>
Wed, 24 Jul 2013 08:56:37 +0000 (17:56 +0900)
Change-Id: Icf3fcb1a9084302022d14ddac87c3d7d30af620f

common/FileObject.cpp
common/include/Channel.h
common/include/FileObject.h
server/ServerResource.cpp

index e1d71f33005595ce3b2878dfac06d009897995e5..ce00b807265d3262c60f4783bd4d3a51554dcba3 100644 (file)
@@ -50,7 +50,7 @@ namespace smartcard_service_api
                selectResponse.releaseBuffer();
        }
 
-       bool FileObject::setSelectResponse(ByteArray &response)
+       bool FileObject::setSelectResponse(ByteArray response)
        {
                bool result = false;
 
index 2e0579f2973415b114c288ead7ee7f9902c8e58a..fda7386f76377fef8099eed874530309f483f6e8 100644 (file)
@@ -41,10 +41,10 @@ namespace smartcard_service_api
                SessionHelper *session;
                int channelNum;
 
-               Channel() : Synchronous() { channelNum = -1; }
-               Channel(SessionHelper *session) : Synchronous() { this->session = session; }
+               Channel() : session(NULL), channelNum(-1) {}
+               Channel(SessionHelper *session) : session(session), channelNum(-1) {}
 
-               inline void setSelectResponse(ByteArray &response) { selectResponse = response; }
+               inline void setSelectResponse(ByteArray response) { selectResponse = response; }
 
        public :
                virtual ~Channel() {};
index ec9e90b9505f3cd7494780b3d7ac7e0ad32fca62..55bd2f7a5a77863fdc5849508c9389be4290f876 100644 (file)
@@ -43,7 +43,7 @@ namespace smartcard_service_api
 
        protected:
                ByteArray selectResponse;
-               bool setSelectResponse(ByteArray &response);
+               bool setSelectResponse(ByteArray response);
 
        public:
                static const int SUCCESS = 0;
@@ -68,6 +68,8 @@ namespace smartcard_service_api
                int select(unsigned int fid);
                int selectParent();
 
+               inline ByteArray getSelectResponse() { return selectResponse; }
+
                FCI *getFCI();
                FCP *getFCP();
 
index 232fcdf097d213f6c5af2ea41388756befe4865e..f1048bca3f885b39ffd56de1f43d9c0b1d19ef90 100644 (file)
@@ -528,6 +528,7 @@ namespace smartcard_service_api
                                {
                                        /* remove privilege mode */
                                        channel->unsetPrivilegeMode();
+                                       channel->setSelectResponse(pkcs15.getSelectResponse());
                                }
                                else
                                {
@@ -546,6 +547,7 @@ namespace smartcard_service_api
                                {
                                        /* remove privilege mode */
                                        channel->unsetPrivilegeMode();
+                                       channel->setSelectResponse(file.getSelectResponse());
                                }
                                else
                                {