summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimei Sun <yimei.sun@intel.com>2017-08-10 01:46:52 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-08-10 01:46:52 +0000
commit0fc7409230a02470367dac7561fb40a79dfba737 (patch)
treedd3612797ac08fc7ac12e2ab2b9cff5a8f0be9a7
parent9466681f6812a44d25a81f487bbb7e08b23a9c57 (diff)
parent7ff540db1c955b553f90b4fdd583f556f5fdee4d (diff)
downloadpsb_headers-0fc7409230a02470367dac7561fb40a79dfba737.tar.gz
Fugu-O supprot OEMCrypto v13 requirements am: 8054b9e2c3
am: 7ff540db1c Change-Id: Id5c19a2d07a52602b5ecbdb35c049adf000fba21
-rwxr-xr-xDRM/cc54/inc/wv_mod_drm_api.h87
-rwxr-xr-xDRM/cc54/inc/wv_mod_drm_error.h12
-rwxr-xr-xDRM/cc54/inc/wv_mod_oem_crypto.h10
3 files changed, 100 insertions, 9 deletions
diff --git a/DRM/cc54/inc/wv_mod_drm_api.h b/DRM/cc54/inc/wv_mod_drm_api.h
index 4e5cab0..d3be933 100755
--- a/DRM/cc54/inc/wv_mod_drm_api.h
+++ b/DRM/cc54/inc/wv_mod_drm_api.h
@@ -165,7 +165,8 @@ uint32_t drm_wv_mod_v9_load_keys(uint32_t session_id,
uint32_t num_keys,
const struct drm_wv_mod_key_object *key_array,
const uint8_t *pst,
- uint32_t pst_length);
+ uint32_t pst_length,
+ const uint8_t *srm_restriction_data);
uint32_t drm_wv_mod_v9_generate_rsa_signature(uint32_t session_id,
const uint8_t *message,
@@ -213,7 +214,6 @@ uint32_t drm_wv_mod_load_usage_table(const uint8_t *const usage_table_data,
* Flag indicating if the table has changed since the last
* update_usage_table or load_usage_table call.
*
- * TODO: Return documentation
*/
uint32_t drm_wv_mod_update_usage_table(uint8_t *const usage_table_data,
uint32_t data_size,
@@ -221,8 +221,8 @@ uint32_t drm_wv_mod_update_usage_table(uint8_t *const usage_table_data,
// NOTE: drm_wv_mod_update_usage_table shall be called after calling this
// function
-// TODO: Documentation
-uint32_t drm_wv_mod_deactivate_usage_entry(const uint8_t *const pst,
+uint32_t drm_wv_mod_deactivate_usage_entry(uint32_t session_id,
+ const uint8_t *const pst,
uint32_t pst_length);
/**
@@ -243,7 +243,6 @@ uint32_t drm_wv_mod_deactivate_usage_entry(const uint8_t *const pst,
* sizeof(struct OEMCrypto_PST_Report) in length. If extra space is provided,
* this field will reflect the actual size of the returned report.
*
- * TODO: Return documentation
*/
uint32_t drm_wv_mod_report_usage(uint32_t session_id,
const uint8_t *const pst,
@@ -271,7 +270,6 @@ uint32_t drm_wv_mod_report_usage(uint32_t session_id,
* @param[in] signature_length
* Length of signature buffer in bytes
*
- * TODO: Return Documentation
*/
uint32_t drm_wv_mod_delete_usage_entry(uint32_t session_id,
const uint8_t *const pst,
@@ -283,7 +281,6 @@ uint32_t drm_wv_mod_delete_usage_entry(uint32_t session_id,
// This will only clear Chaabi TEE memory. Caller is responsible for deleting
// usage table file from file system.
-// TODO: Documentation
uint32_t drm_wv_mod_delete_usage_table(void);
@@ -350,4 +347,80 @@ uint32_t drm_wv_mod_glue_block(uint32_t session_id,
uint32_t cleartext_length,
const uint8_t *iv);
+/*! Version 13 specific APIs */
+
+/*!
+ * Create a new Usage Table Header with no entries.
+ */
+uint32_t drm_wv_mod_create_usage_table_header(uint8_t *header_buffer,
+ uint32_t *header_buffer_length,
+ uint64_t system_time);
+
+/*!
+ * Loads the usage table header into TEE.
+ */
+uint32_t drm_wv_mod_load_usage_table_header(const uint8_t *buffer,
+ uint32_t buffer_length,
+ uint64_t system_time);
+
+/*!
+ * Create a new usage entry.
+ */
+uint32_t drm_wv_mod_create_new_usage_entry(uint32_t session_id,
+ uint32_t *usage_entry_number);
+
+/*!
+ * Load a usage table saved by update usage entry.
+ */
+uint32_t drm_wv_mod_load_usage_entry(uint32_t session_id,
+ uint32_t index,
+ const uint8_t *buffer,
+ uint32_t buffer_length);
+
+/*!
+ * Updates session usage entry.
+ */
+uint32_t drm_wv_mod_update_usage_entry(uint32_t session_id,
+ uint8_t *header_buffer,
+ uint32_t *header_buffer_length,
+ uint8_t *entry_buffer,
+ uint32_t *entry_buffer_length);
+
+/*!
+ * Move usage entry with current session from one location in header to another.
+ */
+uint32_t drm_wv_mod_move_entry(uint32_t session_id,
+ uint32_t new_index);
+
+/*!
+ * Shrinks the usage table and the header.
+ */
+uint32_t drm_wv_mod_shrink_usage_table_header(uint32_t new_entry_count,
+ uint8_t *header_buffer,
+ uint32_t *header_buffer_length);
+
+/*!
+ * Copies an entry from old v12(or earlier) usage table to new table.
+ */
+uint32_t drm_wv_mod_copy_old_usage_entry(uint32_t session_id,
+ const uint8_t *pst,
+ uint32_t pst_length);
+
+/*!
+ * Delete the old usage table.
+ */
+uint32_t drm_wv_mod_delete_old_usage_table(void);
+
+/*!
+ * Create old usage entry.
+ */
+uint32_t drm_wv_mod_create_old_usage_entry(uint64_t time_since_license_received,
+ uint64_t time_since_first_decrypt,
+ uint64_t time_since_last_decrypt,
+ enum drm_wv_mod_usage_entry_status status,
+ uint8_t *server_mac_key,
+ uint8_t *client_mac_key,
+ const uint8_t *pst,
+ uint32_t pst_length);
+
#endif /* __WV_MOD_DRM_API_H_ */
diff --git a/DRM/cc54/inc/wv_mod_drm_error.h b/DRM/cc54/inc/wv_mod_drm_error.h
index b10c2eb..6b33d08 100755
--- a/DRM/cc54/inc/wv_mod_drm_error.h
+++ b/DRM/cc54/inc/wv_mod_drm_error.h
@@ -58,7 +58,7 @@ enum drm_wv_mod_result
DRM_WV_MOD_ENCRYPTION_DECRYPTION_SIZE_INCORRECT,
DRM_WV_MOD_ERROR_BUFFER_TOO_SMALL,
DRM_WV_MOD_ERROR_BUFFER_TYPE_INVALID,
- DRM_WV_MOD_ERROR_DATA_SIZE_TOO_LARGE,
+ DRM_WV_MOD_ERROR_BUFFER_TOO_LARGE,
DRM_WV_MOD_ERROR_RETURN_BUFFER_TOO_SMALL,
DRM_WV_MOD_ERROR_DMA_DATA_SIZE_TOO_LARGE,
DRM_WV_MOD_ERROR_NONCE_GENERATION_FAILURE,
@@ -74,7 +74,15 @@ enum drm_wv_mod_result
DRM_WV_MOD_ERROR_INVALID_USAGE_TABLE_GENERATION_NUM,
DRM_WV_MOD_ERROR_INVALID_USAGE_TABLE_MAGIC,
DRM_WV_MOD_ERROR_USAGE_TABLE_NOT_INITIALIZED,
- DRM_WV_MOD_ERROR_INVALID_CIPHER_MODE
+ DRM_WV_MOD_ERROR_INVALID_CIPHER_MODE,
+ DRM_WV_MOD_ERROR_GENERATION_NUM_SKEW,
+ DRM_WV_MOD_WARNING_GENERATION_NUM_SKEW,
+ DRM_WV_MOD_ERROR_ENTRY_IN_USE,
+ DRM_WV_MOD_ERROR_ENTRY_NEEDS_UPDATE,
+ DRM_WV_MOD_ERROR_ANALOG_OUTPUT,
+ DRM_WV_MOD_ERROR_WRONG_PST,
+ DRM_WV_MOD_ERROR_MISSING_MASTER,
+ DRM_WV_MOD_ERROR_LICENSE_INACTIVE
};
#endif
diff --git a/DRM/cc54/inc/wv_mod_oem_crypto.h b/DRM/cc54/inc/wv_mod_oem_crypto.h
index 42ed033..bdba935 100755
--- a/DRM/cc54/inc/wv_mod_oem_crypto.h
+++ b/DRM/cc54/inc/wv_mod_oem_crypto.h
@@ -32,6 +32,16 @@ enum drm_wv_mod_rsa_padding_scheme
DRM_WV_MOD_RSA_PADDING_SCHEME_MAX_VALUE
};
+enum drm_wv_mod_usage_entry_status
+{
+ k_free = -1,
+ k_unused = 0,
+ k_active = 1,
+ k_inactive = 2, // deprecated in v13
+ k_inactive_used = 3,
+ k_inactive_unused = 4
+};
+
struct drm_wv_mod_key_object
{
const uint8_t *key_id;