From 91126240ced6e21e594ba4adf381baddc0fd1c2e Mon Sep 17 00:00:00 2001 From: Wonkyu Kwon Date: Wed, 22 May 2013 19:38:48 +0900 Subject: [PATCH] Fix to store the select response Change-Id: Icf3fcb1a9084302022d14ddac87c3d7d30af620f --- common/FileObject.cpp | 2 +- common/include/Channel.h | 6 +++--- common/include/FileObject.h | 4 +++- server/ServerResource.cpp | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/FileObject.cpp b/common/FileObject.cpp index e1d71f3..ce00b80 100644 --- a/common/FileObject.cpp +++ b/common/FileObject.cpp @@ -50,7 +50,7 @@ namespace smartcard_service_api selectResponse.releaseBuffer(); } - bool FileObject::setSelectResponse(ByteArray &response) + bool FileObject::setSelectResponse(ByteArray response) { bool result = false; diff --git a/common/include/Channel.h b/common/include/Channel.h index 2e0579f..fda7386 100644 --- a/common/include/Channel.h +++ b/common/include/Channel.h @@ -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() {}; diff --git a/common/include/FileObject.h b/common/include/FileObject.h index ec9e90b..55bd2f7 100644 --- a/common/include/FileObject.h +++ b/common/include/FileObject.h @@ -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(); diff --git a/server/ServerResource.cpp b/server/ServerResource.cpp index 232fcdf..f1048bc 100644 --- a/server/ServerResource.cpp +++ b/server/ServerResource.cpp @@ -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 { -- 2.7.4