Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes uses of OPENSSL_free #135

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/plugins/threaded-signing/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ signature_info_free(signature_info_t *signature_info)
if (!signature_info) return;

free(signature_info->private_key);
if (signature_info->signature) openssl_free(signature_info->signature);
free(signature_info->signature);
free(signature_info->hash);
free(signature_info);
}
Expand Down Expand Up @@ -890,7 +890,7 @@ sv_interface_malloc(size_t data_size)
void
sv_interface_free(uint8_t *data)
{
openssl_free(data);
free(data);
}

/* This plugin initializer expects the |user_data| to be a signature_info_t struct. Only the
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/unthreaded-signing/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ sv_signing_plugin_session_teardown(void *handle)
if (!self) return;

free(self->signature_info.private_key);
if (self->signature_info.signature) openssl_free(self->signature_info.signature);
free(self->signature_info.signature);
free(self);
}

Expand All @@ -204,7 +204,7 @@ sv_interface_malloc(size_t data_size)
void
sv_interface_free(uint8_t *data)
{
openssl_free(data);
free(data);
}

int
Expand Down
10 changes: 0 additions & 10 deletions lib/src/includes/signed_video_openssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ openssl_create_handle(void);
void
openssl_free_handle(void *handle);

/**
* @brief Frees data
*
* Free the allocated data memory.
*
* @param data Pointer to the data.
*/
void
openssl_free(uint8_t *data);

/**
* @brief Hashes data into a 256 bit hash
*
Expand Down
2 changes: 1 addition & 1 deletion lib/src/signed_video_h26x_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ signature_free(signature_info_t *self)
free(self->private_key);
free(self->public_key);
free(self->hash);
sv_interface_free(self->signature);
free(self->signature);
free(self);
}

Expand Down
7 changes: 0 additions & 7 deletions lib/src/signed_video_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ openssl_create_private_key(sign_algo_t algo, const char *path_to_key, key_paths_
#define PRIVATE_RSA_KEY_FILE "private_rsa_key.pem"
#define PRIVATE_ECDSA_KEY_FILE "private_ecdsa_key.pem"

/* Free the data allocated by OpenSSL. */
void
openssl_free(uint8_t *data)
{
OPENSSL_free(data);
}

/* Allocates enough memory for the signature when using the |private_key| in |signature_info|. */
SignedVideoReturnCode
openssl_signature_malloc(signature_info_t *signature_info)
Expand Down
Loading