Changed return type to void 28/78228/3
authorMateusz Forc <m.forc@samsung.com>
Mon, 4 Jul 2016 14:54:19 +0000 (16:54 +0200)
committerMateusz Forc <m.forc@samsung.com>
Mon, 4 Jul 2016 15:28:08 +0000 (17:28 +0200)
Changed yaca_free, yaca_key_destroy, yaca_context_destroy ret type:
int->void and respectievely doxygen comments

Change-Id: Idfe8e1a17574c66990d81e95c3caed3799595b3f

api/yaca/yaca_crypto.h
api/yaca/yaca_key.h
src/crypto.c
src/key.c

index 17ad90b..baf0315 100644 (file)
@@ -150,14 +150,11 @@ int yaca_realloc(size_t size, void **memory);
  *
  * @param[in] memory  Pointer to the memory to be freed
  *
- * @return #YACA_ERROR_NONE on success
- * @retval #YACA_ERROR_NONE Successful
- *
  * @see yaca_malloc()
  * @see yaca_zalloc()
  * @see yaca_realloc()
  */
-int yaca_free(void *memory);
+void yaca_free(void *memory);
 
 /**
  * @brief  Safely compares first @a len bytes of two buffers.
@@ -251,13 +248,10 @@ int yaca_context_get_property(const yaca_context_h ctx,
  *
  * @param[in,out] ctx  Crypto context
  *
- * @return #YACA_ERROR_NONE on success
- * @retval #YACA_ERROR_NONE Successful
- *
  * @see #yaca_context_h
  *
  */
-int yaca_context_destroy(yaca_context_h ctx);
+void yaca_context_destroy(yaca_context_h ctx);
 
 /**
  * @brief  Returns the output length for a given algorithm. Can only be called
index 4ad7ff4..75fb2ca 100644 (file)
@@ -235,14 +235,11 @@ int yaca_key_extract_public(const yaca_key_h prv_key, yaca_key_h *pub_key);
  *
  * @param[in,out] key  Key to be freed
  *
- * @return #YACA_ERROR_NONE on success
- * @retval #YACA_ERROR_NONE Successful
- *
  * @see yaca_key_import()
  * @see yaca_key_export()
  * @see yaca_key_generate()
  */
-int yaca_key_destroy(yaca_key_h key);
+void yaca_key_destroy(yaca_key_h key);
 
 /**@}*/
 
index e4c1f29..158bcf8 100644 (file)
@@ -235,11 +235,9 @@ API int yaca_realloc(size_t size, void **memory)
        return YACA_ERROR_NONE;
 }
 
-API int yaca_free(void *memory)
+API void yaca_free(void *memory)
 {
        OPENSSL_free(memory);
-
-       return YACA_ERROR_NONE;
 }
 
 API int yaca_randomize_bytes(char *data, size_t data_len)
@@ -277,15 +275,13 @@ API int yaca_context_get_property(const yaca_context_h ctx, yaca_property_e prop
        return ctx->get_param(ctx, property, value, value_len);
 }
 
-API int yaca_context_destroy(yaca_context_h ctx)
+API void yaca_context_destroy(yaca_context_h ctx)
 {
        if (ctx != YACA_CONTEXT_NULL) {
                assert(ctx->ctx_destroy != NULL);
                ctx->ctx_destroy(ctx);
                yaca_free(ctx);
        }
-
-       return YACA_ERROR_NONE;
 }
 
 API int yaca_context_get_output_length(const yaca_context_h ctx,
index a368488..2511437 100644 (file)
--- a/src/key.c
+++ b/src/key.c
@@ -1186,7 +1186,7 @@ exit:
        return ret;
 }
 
-API int yaca_key_destroy(yaca_key_h key)
+API void yaca_key_destroy(yaca_key_h key)
 {
        struct yaca_key_simple_s *simple_key = key_get_simple(key);
        struct yaca_key_evp_s *evp_key = key_get_evp(key);
@@ -1198,8 +1198,6 @@ API int yaca_key_destroy(yaca_key_h key)
                EVP_PKEY_free(evp_key->evp);
                yaca_free(evp_key);
        }
-
-       return YACA_ERROR_NONE;
 }
 
 API int yaca_key_derive_pbkdf2(const char *password,