forked from wolfSSL/wolfssl
fix unused variables
This commit is contained in:
@@ -11451,14 +11451,18 @@ int wc_AesInit_Label(Aes* aes, const char* label, void* heap, int devId)
|
|||||||
void wc_AesFree(Aes* aes)
|
void wc_AesFree(Aes* aes)
|
||||||
{
|
{
|
||||||
void* heap;
|
void* heap;
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
byte isAllocated;
|
byte isAllocated;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (aes == NULL) {
|
if (aes == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
heap = aes->heap;
|
heap = aes->heap;
|
||||||
isAllocated = aes->isAllocated;
|
isAllocated = aes->isAllocated;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WC_DEBUG_CIPHER_LIFECYCLE
|
#ifdef WC_DEBUG_CIPHER_LIFECYCLE
|
||||||
(void)wc_debug_CipherLifecycleFree(&aes->CipherLifecycleTag, heap, 1);
|
(void)wc_debug_CipherLifecycleFree(&aes->CipherLifecycleTag, heap, 1);
|
||||||
@@ -11532,6 +11536,7 @@ void wc_AesFree(Aes* aes)
|
|||||||
XFREE(aes, heap, DYNAMIC_TYPE_AES);
|
XFREE(aes, heap, DYNAMIC_TYPE_AES);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
(void)heap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1026,13 +1026,16 @@ int wc_ed25519_init(ed25519_key* key)
|
|||||||
void wc_ed25519_free(ed25519_key* key)
|
void wc_ed25519_free(ed25519_key* key)
|
||||||
{
|
{
|
||||||
void* heap;
|
void* heap;
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
byte isAllocated = 0;
|
byte isAllocated = 0;
|
||||||
|
#endif
|
||||||
if (key == NULL)
|
if (key == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
heap = key->heap;
|
heap = key->heap;
|
||||||
isAllocated = key->isAllocated;
|
isAllocated = key->isAllocated;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WOLFSSL_ED25519_PERSISTENT_SHA
|
#ifdef WOLFSSL_ED25519_PERSISTENT_SHA
|
||||||
ed25519_hash_free(key, &key->sha);
|
ed25519_hash_free(key, &key->sha);
|
||||||
@@ -1050,9 +1053,9 @@ void wc_ed25519_free(ed25519_key* key)
|
|||||||
#ifndef WOLFSSL_NO_MALLOC
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
if (isAllocated) {
|
if (isAllocated) {
|
||||||
XFREE(key, heap, DYNAMIC_TYPE_ED25519);
|
XFREE(key, heap, DYNAMIC_TYPE_ED25519);
|
||||||
(void)heap;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
(void)heap;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -712,7 +712,9 @@ int wc_HashInit_ex(wc_HashAlg* hash, enum wc_HashType type, void* heap,
|
|||||||
if (hash == NULL)
|
if (hash == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
hash->isAllocated = 0;
|
hash->isAllocated = 0;
|
||||||
|
#endif
|
||||||
hash->type = type;
|
hash->type = type;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -1044,11 +1046,13 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type)
|
|||||||
{
|
{
|
||||||
int ret = WC_NO_ERR_TRACE(HASH_TYPE_E); /* Default to hash type error */
|
int ret = WC_NO_ERR_TRACE(HASH_TYPE_E); /* Default to hash type error */
|
||||||
void* heap = NULL;
|
void* heap = NULL;
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
byte isAllocated = 0;
|
byte isAllocated = 0;
|
||||||
|
#endif
|
||||||
if (hash == NULL)
|
if (hash == NULL)
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_WOLFSSL
|
#ifdef DEBUG_WOLFSSL
|
||||||
if (hash->type != type) {
|
if (hash->type != type) {
|
||||||
WOLFSSL_MSG("Hash free type mismatch!");
|
WOLFSSL_MSG("Hash free type mismatch!");
|
||||||
@@ -1056,7 +1060,9 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
isAllocated = hash->isAllocated;
|
isAllocated = hash->isAllocated;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WC_HASH_TYPE_MD5:
|
case WC_HASH_TYPE_MD5:
|
||||||
@@ -1175,9 +1181,9 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type)
|
|||||||
#ifndef WOLFSSL_NO_MALLOC
|
#ifndef WOLFSSL_NO_MALLOC
|
||||||
if (isAllocated) {
|
if (isAllocated) {
|
||||||
XFREE(hash, heap, DYNAMIC_TYPE_HASHES);
|
XFREE(hash, heap, DYNAMIC_TYPE_HASHES);
|
||||||
(void)heap;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
(void)heap;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user