Security/Tizen 2.X key-manager

From Tizen Wiki
Jump to: navigation, search

Introduction

A key manager provides a secure repository for keys, certificates, and sensitive data related to users and their password-protected APPs. Additionally, it provides secure cryptographic operations for non-exportable keys without revealing the key values to clients. A key manager stores keys, certificates, and sensitive user data in a central secure repository. The central secure repository is protected by a password.
Key-manager-overview.png

Data Store Policy

A client can specify simple access rules when storing data in the key manager:
  • Extractable or non-extractable
    - Only for data tagged as extractable, the key manager returns the raw value of the data.
    - If data is tagged as non-extractable, the key manager does not return its raw value. In that case, the key manager provides secure cryptographic operations for non-exportable keys without revealing the key values to the clients.
  • Per key password
    - All data in the key manager is protected by a user password.
    - A client can encrypt its data using their own password additionally.
    - If a client provides a password when storing data, the data is encrypted with the password. This password must be provided when getting the data from the key manager.


User Login

The user login control is implemented as follows:

  • A user's database file is encrypted by a the user's DDEK (Data Encryption Key for DB). DDEK of a user is randomly generated and stored as protected with DKEK(Domain Key Encryption Key) and a DKEK of a user is randomly generated and stored as encrypted with a user password when a user logs in for the first time.
  • When a user logs in, the key manager decrypts the user DKEK with a user password. During the login session, any client can access the data which is protected by a user password.
  • When a user logs in, or changes their password, the key manager are notified by only privileged APPs or platform modules.
  • When a user changes their password, the key manager re-encrypts the user DKEK with the new password.
Key-manager-login.png


Data Access Control

  • By default, only the owner of a data can access to the data.
  • If the owner grants the access to other applications, those applications can read or delete the data from key-manager DB.
  • When an application is deleted, the data and access control information granted by the application are also removed.


Alias Format

  • The format of alias is “package_id name” and the name should not contain any white space characters.
  • If package_id is not provided by a client, the key-manager will add the package_id of the client to the name internally.
  • The client can specify only its own package id in the alias when storing a key, certificate, or data.
  • A client should specify the package id of the owner in the alias to retrieve a a key, certificate, or data shared by other applications.
  • Aliases are returned from the key-manager as the format of "package_id name" (package_id of data owner is attached automatically).


Key Hierarchy and Data Protection

  • All keys are protected by a user's password.
  • A user DB file is encrypted by each user's DDEK(multi-user support).
  • An ADEK is allocated for each App. An ADEK encrypts the App's data.
  • An App can encrypt its data(except cert) additionally using "per key password".
Key-manager-keyhierarchy.png


CC mode support

Key manager listens to the change of CC(common criteria) mode. When CC mode is on, some features are restricted or changed.

  • Private Key is not exported out of key manager in CC mode on.
    - A client can specify the ‘extractable‘ attribute when storing data in the key manager.
    - Only for data tagged as extractable, the key manager returns the raw value of the data.
    - If data is tagged as non-extractable, the key manager does not return its raw value. In that case, the key manager provides secure cryptographic operations for non-exportable keys without revealing the key values to the clients.
    - In case of CC mode on, the key manager does not return the raw values of private keys even if data is tagged as extractable.
  • "Per key password" is disabled in CC mode on.
    - All data in the key manager is protected by a user password.
    - A client can encrypt its data using their own “per key password” additionally.
    - But, in CC mode on, this feature is disabled because the per key password is out of the key hierarchy.
  • FIPS mode of openssl is on in CC mode on.
    - The key manager uses openssl as a crypto engine.
    - When the CC mode is on, the key manager enable the FIPS mode of openssl.
  • Certificates are strictly verified in CC mode on.
    - Only certificates with CA Flag=true are recognized as a CA certificate.
    - OCSP check is done during the certificate verification process.