From 3e2ead07fc1d277395326bbc0a62ef747cd3f337 Mon Sep 17 00:00:00 2001 From: Lukasz Pawelczyk Date: Fri, 13 May 2016 17:51:07 +0200 Subject: [PATCH] Get rid of few TODOs that no longer apply Change-Id: I0763fba2200770137eb73e9a7c4ee4ff4858e35d --- api/yaca/crypto.h | 4 ---- examples/encrypt.c | 4 ++-- examples/encrypt_aes_gcm.c | 4 ++-- src/sign.c | 6 ++---- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/api/yaca/crypto.h b/api/yaca/crypto.h index ec6ac1b..9959df0 100644 --- a/api/yaca/crypto.h +++ b/api/yaca/crypto.h @@ -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); /** diff --git a/examples/encrypt.c b/examples/encrypt.c index 6233f7b..c253586 100644 --- a/examples/encrypt.c +++ b/examples/encrypt.c @@ -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; } diff --git a/examples/encrypt_aes_gcm.c b/examples/encrypt_aes_gcm.c index 23fd4e9..9fc1234 100644 --- a/examples/encrypt_aes_gcm.c +++ b/examples/encrypt_aes_gcm.c @@ -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; } diff --git a/src/sign.c b/src/sign.c index e629210..7dd2a73 100644 --- a/src/sign.c +++ b/src/sign.c @@ -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; -- 2.7.4