From 8e98150bdb9e8fbf5c44726919d57735b9173144 Mon Sep 17 00:00:00 2001 From: Semun Lee Date: Thu, 26 Dec 2019 14:40:41 +0900 Subject: [PATCH] Fix build warnings for gcc 9 Removed all the dynamic exception specification Change-Id: I4fc666788e033c59247c07ebc98c84ed4010ab6e Signed-off-by: Semun Lee --- common/include/Channel.h | 8 ++----- common/include/Exception.h | 2 -- common/include/ReaderHelper.h | 7 ++---- common/include/SessionHelper.h | 43 +++++++++------------------------- server/ServerChannel.cpp | 2 -- server/ServerReader.cpp | 3 --- server/ServerResource.cpp | 2 -- server/ServerSession.cpp | 15 ------------ server/include/ServerChannel.h | 6 ++--- server/include/ServerReader.h | 9 +++----- server/include/ServerResource.h | 6 ++--- server/include/ServerSession.h | 51 +++++++++++++++-------------------------- 12 files changed, 40 insertions(+), 114 deletions(-) diff --git a/common/include/Channel.h b/common/include/Channel.h index 1f6a75e..72498c9 100644 --- a/common/include/Channel.h +++ b/common/include/Channel.h @@ -63,13 +63,9 @@ namespace smartcard_service_api virtual int close(closeChannelCallback callback, void *userParam) = 0; virtual int transmit(const ByteArray &command, transmitCallback callback, void *userData) = 0; - virtual void closeSync() - throw(ExceptionBase &, ErrorIO &, ErrorSecurity &, - ErrorIllegalState &, ErrorIllegalParameter &) = 0; + virtual void closeSync() = 0; - virtual int transmitSync(const ByteArray &command, ByteArray &result) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual int transmitSync(const ByteArray &command, ByteArray &result) = 0; }; /* LCOV_EXCL_STOP */ diff --git a/common/include/Exception.h b/common/include/Exception.h index 2f3aa8f..8dc9f9e 100644 --- a/common/include/Exception.h +++ b/common/include/Exception.h @@ -222,8 +222,6 @@ namespace smartcard_service_api { public : static void throwError(int errorCode) - throw(ExceptionBase &, ErrorIO &, ErrorSecurity &, - ErrorIllegalState &, ErrorIllegalParameter &) { switch (errorCode) { diff --git a/common/include/ReaderHelper.h b/common/include/ReaderHelper.h index f9954dd..13243f2 100644 --- a/common/include/ReaderHelper.h +++ b/common/include/ReaderHelper.h @@ -55,13 +55,10 @@ namespace smartcard_service_api inline SEServiceHelper *getSEService() const { return seService; } inline bool isSecureElementPresent() const { return present; } - virtual void closeSessions() - throw(ErrorIO &, ErrorIllegalState &) = 0; + virtual void closeSessions() = 0; virtual int openSession(openSessionCallback callback, void *userData) = 0; - virtual SessionHelper *openSessionSync() - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &)= 0; + virtual SessionHelper *openSessionSync() = 0; }; /* LCOV_EXCL_STOP */ diff --git a/common/include/SessionHelper.h b/common/include/SessionHelper.h index 85a15c1..5c0d2a1 100644 --- a/common/include/SessionHelper.h +++ b/common/include/SessionHelper.h @@ -55,8 +55,7 @@ namespace smartcard_service_api ReaderHelper *getReader() const throw() { return reader; } bool isClosed() const throw() { return closed; } - virtual void closeChannels() - throw(ErrorIO &, ErrorIllegalState &) = 0; + virtual void closeChannels() = 0; virtual int getATR(getATRCallback callback, void *userData) = 0; virtual int close(closeSessionCallback callback, void *userData) = 0; @@ -66,45 +65,25 @@ namespace smartcard_service_api virtual int openLogicalChannel(const ByteArray &aid, openChannelCallback callback, void *userData) = 0; virtual int openLogicalChannel(const unsigned char *aid, unsigned int length, openChannelCallback callback, void *userData) = 0; - virtual const ByteArray getATRSync() - throw(ExceptionBase &, ErrorIO &, ErrorSecurity &, - ErrorIllegalState &, ErrorIllegalParameter &) = 0; + virtual const ByteArray getATRSync() = 0; - virtual void closeSync() - throw(ExceptionBase &, ErrorIO &, ErrorSecurity &, - ErrorIllegalState &, ErrorIllegalParameter &) = 0; + virtual void closeSync() = 0; - virtual Channel *openBasicChannelSync(const ByteArray &aid) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openBasicChannelSync(const ByteArray &aid) = 0; - virtual Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length) = 0; - virtual Channel *openLogicalChannelSync(const ByteArray &aid) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openLogicalChannelSync(const ByteArray &aid) = 0; - virtual Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length) = 0; - virtual Channel *openBasicChannelSync(const ByteArray &aid, unsigned char P2) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openBasicChannelSync(const ByteArray &aid, unsigned char P2) = 0; - virtual Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) = 0; - virtual Channel *openLogicalChannelSync(const ByteArray &aid, unsigned char P2) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openLogicalChannelSync(const ByteArray &aid, unsigned char P2) = 0; - virtual Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) - throw(ExceptionBase &, ErrorIO &, ErrorIllegalState &, - ErrorIllegalParameter &, ErrorSecurity &) = 0; + virtual Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) = 0; }; /* LCOV_EXCL_STOP */ diff --git a/server/ServerChannel.cpp b/server/ServerChannel.cpp index 42b6929..b2eab14 100644 --- a/server/ServerChannel.cpp +++ b/server/ServerChannel.cpp @@ -43,7 +43,6 @@ namespace smartcard_service_api } void ServerChannel::closeSync() - throw(ErrorIO &, ErrorIllegalState &) { ByteArray command, result; APDUHelper apdu; @@ -74,7 +73,6 @@ namespace smartcard_service_api } int ServerChannel::transmitSync(const ByteArray &command, ByteArray &result) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { int ret = -1; APDUCommand helper; diff --git a/server/ServerReader.cpp b/server/ServerReader.cpp index 877f7c2..b0c8574 100644 --- a/server/ServerReader.cpp +++ b/server/ServerReader.cpp @@ -53,7 +53,6 @@ namespace smartcard_service_api } void ServerReader::closeSessions() - throw(ErrorIO &, ErrorIllegalState &) { size_t i; @@ -67,7 +66,6 @@ namespace smartcard_service_api } ServerSession *ServerReader::openSessionSync() - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { vector temp; @@ -75,7 +73,6 @@ namespace smartcard_service_api } ServerSession *ServerReader::openSessionSync(const vector &certHashes, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ServerSession *session = NULL; diff --git a/server/ServerResource.cpp b/server/ServerResource.cpp index 55e0d8f..553da20 100755 --- a/server/ServerResource.cpp +++ b/server/ServerResource.cpp @@ -291,7 +291,6 @@ namespace smartcard_service_api } unsigned int ServerResource::createChannel(const char *name, unsigned int handle, unsigned int sessionID, int channelType, ByteArray aid) - throw(ExceptionBase &) { unsigned int result = -1; ServiceInstance *service = NULL; @@ -555,7 +554,6 @@ namespace smartcard_service_api unsigned int ServerResource::_createChannel(Terminal *terminal, ServiceInstance *service, int channelType, unsigned int sessionID, const ByteArray &aid) - throw(ExceptionBase &) { unsigned int result = IntegerHandle::INVALID_HANDLE; int channelNum = 0; diff --git a/server/ServerSession.cpp b/server/ServerSession.cpp index c0c6ac9..829dcbe 100644 --- a/server/ServerSession.cpp +++ b/server/ServerSession.cpp @@ -55,7 +55,6 @@ namespace smartcard_service_api } const ByteArray ServerSession::getATRSync() - throw(ErrorIO &, ErrorIllegalState &) { /* call get atr to terminal */ if (atr.isEmpty()) { @@ -80,7 +79,6 @@ namespace smartcard_service_api } void ServerSession::closeSync() - throw(ErrorIO &, ErrorIllegalState &) { if (isClosed() == false) { @@ -90,7 +88,6 @@ namespace smartcard_service_api } void ServerSession::closeChannels() - throw(ErrorIO &, ErrorIllegalState &) { size_t i; @@ -104,19 +101,16 @@ namespace smartcard_service_api } Channel *ServerSession::openBasicChannelSync(const ByteArray &aid) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { return openBasicChannelSync(aid, (void *)NULL); } Channel *ServerSession::openBasicChannelSync(const ByteArray &aid, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { return openBasicChannelSync(aid, (void *)NULL); } Channel *ServerSession::openBasicChannelSync(const ByteArray &aid, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ServerChannel *channel = NULL; #if 0 @@ -166,7 +160,6 @@ namespace smartcard_service_api } Channel *ServerSession::openBasicChannelSync(const unsigned char *aid, unsigned int length) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { unsigned char P2 = 0x00; ByteArray temp(aid, length); @@ -175,7 +168,6 @@ namespace smartcard_service_api } Channel *ServerSession::openBasicChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ByteArray temp(aid, length); @@ -183,7 +175,6 @@ namespace smartcard_service_api } Channel *ServerSession::openBasicChannelSync(const unsigned char *aid, unsigned int length, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ByteArray temp(aid, length); @@ -191,21 +182,18 @@ namespace smartcard_service_api } Channel *ServerSession::openLogicalChannelSync(const ByteArray &aid) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { void* caller = NULL; return openLogicalChannelSync(aid, caller); } Channel *ServerSession::openLogicalChannelSync(const ByteArray &aid, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { void* caller = NULL; return openLogicalChannelSync(aid, caller); } Channel *ServerSession::openLogicalChannelSync(const ByteArray &aid, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ServerChannel *channel = NULL; #if 0 @@ -276,7 +264,6 @@ namespace smartcard_service_api } Channel *ServerSession::openLogicalChannelSync(const unsigned char *aid, unsigned int length) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { unsigned char P2 = 0x00; ByteArray temp(aid, length); @@ -285,7 +272,6 @@ namespace smartcard_service_api } Channel *ServerSession::openLogicalChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ByteArray temp(aid, length); @@ -293,7 +279,6 @@ namespace smartcard_service_api } Channel *ServerSession::openLogicalChannelSync(const unsigned char *aid, unsigned int length, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &) { ByteArray temp(aid, length); diff --git a/server/include/ServerChannel.h b/server/include/ServerChannel.h index cb27435..4cc6f50 100644 --- a/server/include/ServerChannel.h +++ b/server/include/ServerChannel.h @@ -41,10 +41,8 @@ namespace smartcard_service_api void unsetPrivilegeMode() { this->privilege = false; } protected: - void closeSync() - throw(ErrorIO &, ErrorIllegalState &); - int transmitSync(const ByteArray &command, ByteArray &result) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); + void closeSync(); + int transmitSync(const ByteArray &command, ByteArray &result); public: ~ServerChannel(); diff --git a/server/include/ServerReader.h b/server/include/ServerReader.h index f29b21a..7695a9a 100644 --- a/server/include/ServerReader.h +++ b/server/include/ServerReader.h @@ -48,13 +48,10 @@ namespace smartcard_service_api int openSession(void *caller, openSessionCallback callback, void *userData) { return -1; } public: - void closeSessions() - throw(ErrorIO &, ErrorIllegalState &); + void closeSessions(); - ServerSession *openSessionSync() - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - ServerSession *openSessionSync(const vector &certHashes, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); + ServerSession *openSessionSync(); + ServerSession *openSessionSync(const vector &certHashes, void *caller); friend class ServerSEService; }; diff --git a/server/include/ServerResource.h b/server/include/ServerResource.h index 35b5de2..18f15b7 100644 --- a/server/include/ServerResource.h +++ b/server/include/ServerResource.h @@ -75,8 +75,7 @@ namespace smartcard_service_api int _openLogicalChannel(Terminal *terminal); int _closeLogicalChannel(Terminal *terminal, int channelNum); bool _isAuthorizedAccess(ServerChannel *channel, const ByteArray &aid, const vector &hashes); - unsigned int _createChannel(Terminal *terminal, ServiceInstance *service, int channelType, unsigned int sessionID, const ByteArray &aid) - throw(ExceptionBase &); + unsigned int _createChannel(Terminal *terminal, ServiceInstance *service, int channelType, unsigned int sessionID, const ByteArray &aid); public: /* static member */ @@ -118,8 +117,7 @@ namespace smartcard_service_api bool isValidChannelHandle(const char *name, unsigned int handle, unsigned int channelID); unsigned int createChannel(const char *name, unsigned int handle, - unsigned int sessionID, int channelType, ByteArray aid) - throw(ExceptionBase &); + unsigned int sessionID, int channelType, ByteArray aid); Channel *getChannel(const char *name, unsigned int handle, unsigned int channelID); void removeChannel(const char *name, unsigned int handle, unsigned int channelID); void addAccessControlList(Terminal *terminal, AccessControlList *acl); diff --git a/server/include/ServerSession.h b/server/include/ServerSession.h index 0d296f7..abb6357 100644 --- a/server/include/ServerSession.h +++ b/server/include/ServerSession.h @@ -56,39 +56,24 @@ namespace smartcard_service_api public: ~ServerSession(); - const ByteArray getATRSync() - throw(ErrorIO &, ErrorIllegalState &); - void closeSync() - throw(ErrorIO &, ErrorIllegalState &); - - void closeChannels() - throw(ErrorIO &, ErrorIllegalState &); - - Channel *openBasicChannelSync(const ByteArray &aid) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openBasicChannelSync(const ByteArray &aid, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openBasicChannelSync(const ByteArray &aid, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - - Channel *openLogicalChannelSync(const ByteArray &aid) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openLogicalChannelSync(const ByteArray &aid, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openLogicalChannelSync(const ByteArray &aid, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); - Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length, void *caller) - throw(ErrorIO &, ErrorIllegalState &, ErrorIllegalParameter &, ErrorSecurity &); + const ByteArray getATRSync(); + void closeSync(); + + void closeChannels(); + + Channel *openBasicChannelSync(const ByteArray &aid); + Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length); + Channel *openBasicChannelSync(const ByteArray &aid, unsigned char P2); + Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2); + Channel *openBasicChannelSync(const ByteArray &aid, void *caller); + Channel *openBasicChannelSync(const unsigned char *aid, unsigned int length, void *caller); + + Channel *openLogicalChannelSync(const ByteArray &aid); + Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length); + Channel *openLogicalChannelSync(const ByteArray &aid, unsigned char P2); + Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length, unsigned char P2); + Channel *openLogicalChannelSync(const ByteArray &aid, void *caller); + Channel *openLogicalChannelSync(const unsigned char *aid, unsigned int length, void *caller); friend class ServerReader; friend class ServerResource; -- 2.7.4