Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-04-16 17:22:03 +0300
committerTomas Mraz <tomas@openssl.org>2021-04-26 13:05:05 +0300
commit6c9bc258d2e9e7b500236a1c696da1f384f0b907 (patch)
tree28928eb5dc1acc246c1b3309328aea2031056ce3 /crypto/evp/evp_enc.c
parentd21224f1adcd948699e536eaf570f42ef9a051f7 (diff)
Add type_name member to provided methods and use it
Fixes #14701 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14898)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index 2de2a11e5a..50e1c3452b 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -13,15 +13,16 @@
#include <stdio.h>
#include <limits.h>
#include <assert.h>
-#include "internal/cryptlib.h"
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/engine.h>
#include <openssl/params.h>
#include <openssl/core_names.h>
-#include "crypto/evp.h"
+#include "internal/cryptlib.h"
#include "internal/provider.h"
+#include "internal/core.h"
+#include "crypto/evp.h"
#include "evp_local.h"
int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
@@ -1468,6 +1469,10 @@ static void *evp_cipher_from_algorithm(const int name_id,
#endif
cipher->name_id = name_id;
+ if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
+ EVP_CIPHER_free(cipher);
+ return NULL;
+ }
cipher->description = algodef->algorithm_description;
for (; fns->function_id != 0; fns++) {
@@ -1610,6 +1615,7 @@ int EVP_CIPHER_up_ref(EVP_CIPHER *cipher)
void evp_cipher_free_int(EVP_CIPHER *cipher)
{
+ OPENSSL_free(cipher->type_name);
ossl_provider_free(cipher->prov);
CRYPTO_THREAD_lock_free(cipher->lock);
OPENSSL_free(cipher);