Unify CKMLogic methods and fix PKCS12 support 73/287973/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 6 Feb 2023 08:50:25 +0000 (09:50 +0100)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 9 Feb 2023 14:49:09 +0000 (15:49 +0100)
commit6bde8ec258353bd103933d50ad2fad8e762298e8
treef50ec2fa3041b2d619a9349c5e26f14b66767f2c
parent00a95b777966dc0278b1b9cc628789ca4ad17a4e
Unify CKMLogic methods and fix PKCS12 support

Add helper functions for frequently repeated code (input parameter
checks, database selection, permission checks, hash calculation,
transaction start)

Fixed object Id is calculated from uid, pkg_id & alias. PKCS12
components are stored under common alias differing only by type. As a
result, all PKCS12 components are saved with identical object id which
may lead to conflicts.

For PKCS12 add type information as hash function input.

Change-Id: Id54c5eb4e0ad5b3521f2661df64619316cf4a9ea
src/manager/service/access-control.cpp
src/manager/service/access-control.h
src/manager/service/ckm-logic.cpp
src/manager/service/ckm-logic.h
src/manager/service/crypto-logic.cpp
src/manager/service/crypto-logic.h
src/manager/service/db-crypto.h