X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fpem%2Fpem_sign.c;h=c3b9808cb20475016329bf3578b74be8bc156afe;hb=8e6905d23829cf01d0ad8ab4dc9170532de45821;hp=0df99a3d84e981f9ddffe2c6266186c7f8f5447a;hpb=eda1f21f1af8b6f77327e7b37573af9c1ba73726;p=oweals%2Fopenssl.git diff --git a/crypto/pem/pem_sign.c b/crypto/pem/pem_sign.c index 0df99a3d84..c3b9808cb2 100644 --- a/crypto/pem/pem_sign.c +++ b/crypto/pem/pem_sign.c @@ -1,5 +1,5 @@ /* crypto/pem/pem_sign.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -58,38 +58,31 @@ #include #include "cryptlib.h" -#include "rand.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" -#include "pem.h" +#include +#include +#include +#include +#include -void PEM_SignInit(ctx,type) -EVP_MD_CTX *ctx; -EVP_MD *type; +void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) { - EVP_DigestInit(ctx,type); + EVP_DigestInit_ex(ctx, type, NULL); } -void PEM_SignUpdate(ctx,data,count) -EVP_MD_CTX *ctx; -unsigned char *data; -unsigned int count; +void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, + unsigned int count) { EVP_DigestUpdate(ctx,data,count); } -int PEM_SignFinal(ctx,sigret,siglen,pkey) -EVP_MD_CTX *ctx; -unsigned char *sigret; -unsigned int *siglen; -EVP_PKEY *pkey; +int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, + EVP_PKEY *pkey) { unsigned char *m; int i,ret=0; unsigned int m_len; - m=(unsigned char *)Malloc(EVP_PKEY_size(pkey)+2); + m=(unsigned char *)OPENSSL_malloc(EVP_PKEY_size(pkey)+2); if (m == NULL) { PEMerr(PEM_F_PEM_SIGNFINAL,ERR_R_MALLOC_FAILURE); @@ -103,7 +96,7 @@ EVP_PKEY *pkey; ret=1; err: /* ctx has been zeroed by EVP_SignFinal() */ - if (m != NULL) Free(m); + if (m != NULL) OPENSSL_free(m); return(ret); }