#ifndef OPENSSL_NO_ENGINE
# include <openssl/engine.h>
#endif
-#include "asn1_locl.h"
-#include "evp_locl.h"
+#include "internal/asn1_int.h"
+#include "internal/evp_int.h"
typedef int sk_cmp_fn_type(const char *const *a, const char *const *b);
return NULL;
}
- ret = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
+ ret = OPENSSL_malloc(sizeof(*ret));
if (!ret) {
#ifndef OPENSSL_NO_ENGINE
if (e)
EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags)
{
EVP_PKEY_METHOD *pmeth;
- pmeth = OPENSSL_malloc(sizeof(EVP_PKEY_METHOD));
+
+ pmeth = OPENSSL_malloc(sizeof(*pmeth));
if (!pmeth)
return NULL;
- memset(pmeth, 0, sizeof(EVP_PKEY_METHOD));
+ memset(pmeth, 0, sizeof(*pmeth));
pmeth->pkey_id = id;
pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC;
return 0;
}
#endif
- rctx = OPENSSL_malloc(sizeof(EVP_PKEY_CTX));
+ rctx = OPENSSL_malloc(sizeof(*rctx));
if (!rctx)
return NULL;
return;
if (ctx->pmeth && ctx->pmeth->cleanup)
ctx->pmeth->cleanup(ctx);
- if (ctx->pkey)
- EVP_PKEY_free(ctx->pkey);
- if (ctx->peerkey)
- EVP_PKEY_free(ctx->peerkey);
+ EVP_PKEY_free(ctx->pkey);
+ EVP_PKEY_free(ctx->peerkey);
#ifndef OPENSSL_NO_ENGINE
if (ctx->engine)
/*