X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fpem%2Fpem_seal.c;h=2a6c5133481afeea02762f983ace99ed1cb96bf1;hb=7d09713d09f41778c92913d57a877a4eb1aebbfc;hp=fd493e5251ebce3c6a93f1792e7d67c9bf10077e;hpb=6b691a5c85ddc4e407e32781841fee5c029506cd;p=oweals%2Fopenssl.git diff --git a/crypto/pem/pem_seal.c b/crypto/pem/pem_seal.c index fd493e5251..2a6c513348 100644 --- a/crypto/pem/pem_seal.c +++ b/crypto/pem/pem_seal.c @@ -56,13 +56,14 @@ * [including the GNU Public Licence.] */ +#ifndef NO_RSA #include #include "cryptlib.h" -#include "evp.h" -#include "rand.h" -#include "objects.h" -#include "x509.h" -#include "pem.h" +#include +#include +#include +#include +#include int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, @@ -83,7 +84,7 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, j=RSA_size(pubk[i]->pkey.rsa); if (j > max) max=j; } - s=(char *)Malloc(max*2); + s=(char *)OPENSSL_malloc(max*2); if (s == NULL) { PEMerr(PEM_F_PEM_SEALINIT,ERR_R_MALLOC_FAILURE); @@ -107,7 +108,7 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, ret=npubk; err: - if (s != NULL) Free(s); + if (s != NULL) OPENSSL_free(s); memset(key,0,EVP_MAX_KEY_LENGTH); return(ret); } @@ -150,7 +151,7 @@ int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, } i=RSA_size(priv->pkey.rsa); if (i < 100) i=100; - s=(unsigned char *)Malloc(i*2); + s=(unsigned char *)OPENSSL_malloc(i*2); if (s == NULL) { PEMerr(PEM_F_PEM_SEALFINAL,ERR_R_MALLOC_FAILURE); @@ -171,6 +172,13 @@ int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, err: memset((char *)&(ctx->md),0,sizeof(ctx->md)); memset((char *)&(ctx->cipher),0,sizeof(ctx->cipher)); - if (s != NULL) Free(s); + if (s != NULL) OPENSSL_free(s); return(ret); } +#else /* !NO_RSA */ + +# if PEDANTIC +static void *dummy=&dummy; +# endif + +#endif