summaryrefslogtreecommitdiff
path: root/include/web_app_enc.h
diff options
context:
space:
mode:
authorKyungwook Tak <k.tak@samsung.com>2016-07-18 11:28:53 +0900
committerKyungwook Tak <k.tak@samsung.com>2016-07-18 13:54:57 +0900
commitf72179753846682e783bbc4dbe1a3a570e7fac23 (patch)
tree792927dbc3307914f6f45b24a1f3a019e5166c9b /include/web_app_enc.h
parent25dec26957850ba42687ffff35fc226039405654 (diff)
downloadlibwebappenc-f72179753846682e783bbc4dbe1a3a570e7fac23.tar.gz
libwebappenc-f72179753846682e783bbc4dbe1a3a570e7fac23.tar.bz2
libwebappenc-f72179753846682e783bbc4dbe1a3a570e7fac23.zip
Fix C code naming rules & minor fixes
- Remove some goto label which isn't needed - Change 'num' param of strncmp / strncpy with meaningful value (static buffer's size) - Add const to unsigned char array input param - Change param names (c string array and raw buffer array) const char *pPkgId -> pkgId unsigned char *pDek -> dek unsigned char **ppDek -> pDek - Change all camel naminges to underbar - Remove null checking before call free() free() does nothing if ptr is null pointer. (refer: http://linux.die.net/man/3/free) - Add missing closedir() after opendir() Change-Id: I7e5888ed3dc77e5355cfc441f10dc0d6d916921c Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
Diffstat (limited to 'include/web_app_enc.h')
-rw-r--r--include/web_app_enc.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/include/web_app_enc.h b/include/web_app_enc.h
index 7cadf7b..c876792 100644
--- a/include/web_app_enc.h
+++ b/include/web_app_enc.h
@@ -62,12 +62,12 @@ typedef enum {
* @brief Encrypts web application data with internal key(APP DEK: Application Data Encryption Key).
*
* @since_tizen 3.0
- * @param[in] pPkgId The package id of an application.
- * @param[in] appType The application type.
- * @param[in] pData The data block to be encrypted.
- * @param[in] dataLen The length of the data block.
- * @param[out] ppEncryptedData The data block contaning encrypted data block. Memory allocated for ppEncryptedData. Has to be freed by free() function.
- * @param[out] pEncDataLen The length of the encrypted data block.
+ * @param[in] pkg_id The package id of an application
+ * @param[in] app_type The application type
+ * @param[in] data The data block to be encrypted
+ * @param[in] data_len The length of @a data
+ * @param[out] pencrypted_data The data block contaning encrypted data block which must be freed by free()
+ * @param[out] pencrypted_data_len The length of data pointed by @a pencrypted_data
*
* @return #WAE_ERROR_NONE on success, otherwise a negative error value
* @retval #WAE_ERROR_INVALID_PARAMETER Invalid input parameter
@@ -79,18 +79,20 @@ typedef enum {
*
* @see wae_decrypt_web_application()
*/
-int wae_encrypt_web_application(const char *pPkgId, wae_app_type_e appType, const unsigned char *pData, size_t dataLen, unsigned char **ppEncryptedData, size_t *pEncDataLen);
+int wae_encrypt_web_application(const char *pkg_id, wae_app_type_e app_type,
+ const unsigned char *data, size_t data_len,
+ unsigned char **pencrypted_data, size_t *pencrypted_data_len);
/**
* @brief Encrypts web application data with internal key.
*
* @since_tizen 3.0
- * @param[in] pPkgId The package id of an application.
- * @param[in] appType The application type.
- * @param[in] pData The data block to be decrypted.
- * @param[in] dataLen The length of the data block.
- * @param[out] ppDecryptedData Data block contaning decrypted data block. Memory allocated for ppEncryptedData. Has to be freed by free() function.
- * @param[out] pDecDataLen The length of the decrypted data block.
+ * @param[in] pkg_id The package id of an application
+ * @param[in] app_type The application type
+ * @param[in] data The data block to be decrypted
+ * @param[in] data_len The length of @a data
+ * @param[out] pdecrypted_data Data block contaning decrypted data block which must be freed by free()
+ * @param[out] pdecrypted_data_len The length of data pointed by @a pdecrypted_data
*
* @return #WAE_ERROR_NONE on success, otherwise a negative error value
* @retval #WAE_ERROR_INVALID_PARAMETER Invalid input parameter
@@ -102,14 +104,16 @@ int wae_encrypt_web_application(const char *pPkgId, wae_app_type_e appType, cons
*
* @see wae_encrypt_web_application()
*/
-int wae_decrypt_web_application(const char *pPkgId, wae_app_type_e appType, const unsigned char *pData, size_t dataLen, unsigned char **ppDecryptedData, size_t *pDecDataLen);
+int wae_decrypt_web_application(const char *pkg_id, wae_app_type_e app_type,
+ const unsigned char *data, size_t data_len,
+ unsigned char **pdecrypted_data, size_t *pdecrypted_data_len);
/**
* @brief Remove a APP DEK(Application Data Encryption Key) used for encrytpion and decryption of a web application.
*
* @since_tizen 3.0
- * @param[in] pPkgId The package id of an application.
- * @param[in] appType The application type.
+ * @param[in] pkg_id The package id of an application
+ * @param[in] app_type The application type
*
* @return #WAE_ERROR_NONE on success, otherwise a negative error value
* @retval #WAE_ERROR_INVALID_PARAMETER Invalid input parameter
@@ -119,7 +123,7 @@ int wae_decrypt_web_application(const char *pPkgId, wae_app_type_e appType, cons
* @retval #WAE_ERROR_UNKNOWN Failed with unknown reason
*
*/
-int wae_remove_app_dek(const char *pPkgId, wae_app_type_e appType);
+int wae_remove_app_dek(const char *pkg_id, wae_app_type_e app_type);
/**
* @}