Remove CryptoExt class in favor of friendship 49/239049/10
authorMateusz Cegielka <m.cegielka@samsung.com>
Mon, 20 Jul 2020 15:59:15 +0000 (17:59 +0200)
committerMateusz Cegielka <m.cegielka@samsung.com>
Thu, 27 Aug 2020 07:32:33 +0000 (09:32 +0200)
commit5ce2a43ca9f0ffd18f9b7768ec644d13f38c3605
treec082694df870c4e497f351e4fad57177684a6443
parentc806f3ad70a2c694abb0e2bc5e6b695417416b48
Remove CryptoExt class in favor of friendship

In the ckm_db_tool CLI helper project, CKMLogicExt and CryptoExt classes
are responsible for breaking encapsulation of CKMLogic and Crypto
classes. However, code used for extracting a Crypto member and casting
it to the CryptoExt type is repeated two times (soon three), and rather
dangerous.

This refactor makes CKMLogicExt a friend of the Crypto class. This makes
it possible to implement additional methods directly in CKMLogicExt
without doing dangerous slicing object casts.

Change-Id: Ice7261b76f46f9a6206f7ae1faded1f3d8e359cb
misc/ckm_db_tool/CMakeLists.txt
misc/ckm_db_tool/ckm-logic-ext.cpp
misc/ckm_db_tool/db-crypto-ext.cpp [deleted file]
misc/ckm_db_tool/db-crypto-ext.h [deleted file]
src/manager/service/db-crypto.h