diff options
author | Krzysztof Jackiewicz <k.jackiewicz@samsung.com> | 2018-07-19 16:31:27 +0200 |
---|---|---|
committer | Krzysztof Jackiewicz <k.jackiewicz@samsung.com> | 2018-08-28 13:18:39 +0000 |
commit | 31a373a9389e65b242ac1890771bfee06f5cfb51 (patch) | |
tree | 06fe1319997a8a4ddb247e62127b73f833ba900f /src/include | |
parent | b61e8105c2dbdf36b33cc870624ec4ce2efbcadd (diff) | |
download | key-manager-31a373a9389e65b242ac1890771bfee06f5cfb51.tar.gz key-manager-31a373a9389e65b242ac1890771bfee06f5cfb51.tar.bz2 key-manager-31a373a9389e65b242ac1890771bfee06f5cfb51.zip |
Unify alias naming
Get rid of all references to smack labels except database scheme.
alias = owner_id + name
Simplify db permissions processing
Change-Id: I36c3dbb3ee605fb00e5e4e6bcbada6400a0cbcab
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ckm/ckm-control.h | 6 | ||||
-rw-r--r-- | src/include/ckm/ckm-manager-async.h | 2 | ||||
-rw-r--r-- | src/include/ckm/ckm-manager.h | 2 | ||||
-rw-r--r-- | src/include/ckm/ckm-type.h | 12 | ||||
-rw-r--r-- | src/include/ckmc/ckmc-control.h | 17 |
5 files changed, 25 insertions, 14 deletions
diff --git a/src/include/ckm/ckm-control.h b/src/include/ckm/ckm-control.h index dd36f9d1..51b82563 100644 --- a/src/include/ckm/ckm-control.h +++ b/src/include/ckm/ckm-control.h @@ -57,15 +57,15 @@ public: // Required for tizen 2.3. // It will remove all application data owned by application identified - // by smackLabel. This function will remove application data from unlocked + // by owner. This function will remove application data from unlocked // database only. This function may be used during application uninstallation. - virtual int removeApplicationData(const std::string &smackLabel) = 0; + virtual int removeApplicationData(const ClientId &owner) = 0; virtual int updateCCMode() = 0; virtual int setPermission(uid_t user, const Alias &alias, - const Label &accessor, + const ClientId &accessor, PermissionMask permissionMask) = 0; virtual ~Control() {} diff --git a/src/include/ckm/ckm-manager-async.h b/src/include/ckm/ckm-manager-async.h index f812aea9..e8fabaa0 100644 --- a/src/include/ckm/ckm-manager-async.h +++ b/src/include/ckm/ckm-manager-async.h @@ -193,7 +193,7 @@ public: void setPermission( const ObserverPtr &observer, const Alias &alias, - const Label &accessor, + const ClientId &accessor, PermissionMask permissionMask); // This function will encrypt data. diff --git a/src/include/ckm/ckm-manager.h b/src/include/ckm/ckm-manager.h index 8f673841..22ec9a50 100644 --- a/src/include/ckm/ckm-manager.h +++ b/src/include/ckm/ckm-manager.h @@ -143,7 +143,7 @@ public: int ocspCheck(const CertificateShPtrVector &certificateChainVector, int &ocspStatus); - int setPermission(const Alias &alias, const Label &accessor, + int setPermission(const Alias &alias, const ClientId &accessor, PermissionMask permissionMask); // This function will encrypt data. diff --git a/src/include/ckm/ckm-type.h b/src/include/ckm/ckm-type.h index 5a07a3de..5021f263 100644 --- a/src/include/ckm/ckm-type.h +++ b/src/include/ckm/ckm-type.h @@ -38,8 +38,18 @@ namespace CKM { // used to pass password and raw key data typedef std::vector<RawBuffer> RawBufferVector; +/* + * Alias = ClientId + ' ' + Name + * ClientId is optional + */ typedef std::string Alias; -typedef std::string Label; +/* + * ClientId is an identifier of the API caller returned by security-manager(pkgid). + * It can be an application or a system component. + * Depending on the context the ClientId may indicate a data owner, data accessor + * or just a client in general. + */ +typedef std::string ClientId; typedef std::vector<Alias> AliasVector; enum class KeyType : int { diff --git a/src/include/ckmc/ckmc-control.h b/src/include/ckmc/ckmc-control.h index 687deb19..459c4808 100644 --- a/src/include/ckmc/ckmc-control.h +++ b/src/include/ckmc/ckmc-control.h @@ -218,14 +218,15 @@ TIZEN_DEPRECATED_API; * @privilege %http://tizen.org/privilege/keymanager.admin * * @remarks Data identified by @a alias should exist - * @remarks @a alias must contain owner label (<owner label><ckmc_owner_id_separator><name>) - * - * @param[in] user User ID of a user whose data will be affected - * @param[in] alias Data alias for which access will be granted - * @param[in] accessor Package id of the application that will gain access rights - * @param[in] permissions Mask of permissions granted for @a accessor application - * (@a ckmc_permission_e) - * (previous permission mask will be replaced with the new mask value) + * @remarks @a alias must contain owner id and name + * (<owner id><ckmc_owner_id_separator><name>) + * + * @param[in] user User ID of a user whose data will be affected + * @param[in] alias Data alias for which access will be granted + * @param[in] accessor Package id of the application that will gain access rights + * @param[in] mask Mask of permissions granted for @a accessor application + * (@a ckmc_permission_e) + * (previous permission mask will be replaced with the new mask value) * * @return @c 0 on success, otherwise a negative error value * |