Get rid of few TODOs that no longer apply 33/69533/4
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Fri, 13 May 2016 15:51:07 +0000 (17:51 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Wed, 18 May 2016 07:15:14 +0000 (00:15 -0700)
Change-Id: I0763fba2200770137eb73e9a7c4ee4ff4858e35d

api/yaca/crypto.h
examples/encrypt.c
examples/encrypt_aes_gcm.c
src/sign.c

index ec6ac1b..9959df0 100644 (file)
@@ -67,7 +67,6 @@ void yaca_exit(void);
  * @return NULL on failure, pointer to allocated memory otherwise.
  * @see yaca_zalloc(), yaca_realloc(), yaca_free()
  */
-// TODO: this should be a macro to CRYPTO_*
 void *yaca_malloc(size_t size);
 
 /**
@@ -78,7 +77,6 @@ void *yaca_malloc(size_t size);
  * @return NULL on failure, pointer to allocated and zeroed memory otherwise.
  * @see yaca_malloc(), yaca_realloc(), yaca_free()
  */
-// TODO: this should be a macro to CRYPTO_*
 void *yaca_zalloc(size_t size);
 
 /**
@@ -90,7 +88,6 @@ void *yaca_zalloc(size_t size);
  * @return NULL on failure, pointer to allocated memory otherwise.
  * @see yaca_malloc(), yaca_zalloc(), yaca_free()
  */
-// TODO: this should be a macro to CRYPTO_*
 void *yaca_realloc(void *addr, size_t size);
 
 /**
@@ -101,7 +98,6 @@ void *yaca_realloc(void *addr, size_t size);
  * @see yaca_malloc(), yaca_zalloc(), yaca_realloc()
  *
  */
-// TODO: this should be a macro to CRYPTO_*
 void yaca_free(void *ptr);
 
 /**
index 6233f7b..c253586 100644 (file)
@@ -164,7 +164,7 @@ void encrypt_advanced(void)
                dump_hex(enc, 16, "Encrypted data (16 of %zu bytes): ",
                         enc_size);
 
-               yaca_ctx_free(ctx); // TODO: perhaps it should not return value
+               yaca_ctx_free(ctx);
        }
 
        /// Decryption
@@ -233,6 +233,6 @@ int main()
 
        encrypt_advanced();
 
-       yaca_exit(); // TODO: what about handing of return value from exit??
+       yaca_exit();
        return ret;
 }
index 23fd4e9..9fc1234 100644 (file)
@@ -118,7 +118,7 @@ void encrypt_decrypt_aes_gcm(void)
 
                dump_hex(ciphertext, 16, "Encrypted data (16 of %zu bytes): ", ciphertext_len);
 
-               yaca_ctx_free(ctx); // TODO: perhaps it should not return value
+               yaca_ctx_free(ctx);
        }
 
        /// Decryption
@@ -188,6 +188,6 @@ int main()
 
        encrypt_decrypt_aes_gcm();
 
-       yaca_exit(); // TODO: what about handing of return value from exit??
+       yaca_exit();
        return ret;
 }
index e629210..7dd2a73 100644 (file)
@@ -143,8 +143,7 @@ API int yaca_sign_init(yaca_ctx_h *ctx,
        if (ret != 0)
                return ret;
 
-       // TODO: use zalloc when available
-       nc = yaca_malloc(sizeof(struct yaca_sign_ctx_s));
+       nc = yaca_zalloc(sizeof(struct yaca_sign_ctx_s));
        if (nc == NULL) {
                ret = YACA_ERROR_OUT_OF_MEMORY;
                goto free_key;
@@ -261,8 +260,7 @@ API int yaca_verify_init(yaca_ctx_h *ctx,
        if (ret != 0)
                return ret;
 
-       // TODO: use zalloc when available
-       nc = yaca_malloc(sizeof(struct yaca_sign_ctx_s));
+       nc = yaca_zalloc(sizeof(struct yaca_sign_ctx_s));
        if (nc == NULL) {
                ret = YACA_ERROR_OUT_OF_MEMORY;
                goto free_key;