summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_sign.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2001-07-30 23:57:25 +0000
committerBen Laurie <ben@openssl.org>2001-07-30 23:57:25 +0000
commitdbad169019598981174ff46c7a9bf58373b0e53a (patch)
treece8ca1188d5614648f24b03967785543f1edc8f5 /crypto/asn1/a_sign.c
parent3ba5d1cf2eb6ef28ac5f6d9f3d28020d00c5be50 (diff)
Really add the EVP and all of the DES changes.
Diffstat (limited to 'crypto/asn1/a_sign.c')
-rw-r--r--crypto/asn1/a_sign.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c
index 67f130840d..6cc5c37ded 100644
--- a/crypto/asn1/a_sign.c
+++ b/crypto/asn1/a_sign.c
@@ -82,6 +82,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
int i,inl=0,outl=0,outll=0;
X509_ALGOR *a;
+ EVP_MD_CTX_init(&ctx);
for (i=0; i<2; i++)
{
if (i == 0)
@@ -141,7 +142,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
signature->flags|=ASN1_STRING_FLAG_BITS_LEFT;
err:
- memset(&ctx,0,sizeof(ctx));
+ EVP_MD_CTX_cleanup(&ctx);
if (buf_in != NULL)
{ memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
if (buf_out != NULL)
@@ -160,6 +161,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
int i,inl=0,outl=0,outll=0;
X509_ALGOR *a;
+ EVP_MD_CTX_init(&ctx);
for (i=0; i<2; i++)
{
if (i == 0)
@@ -216,7 +218,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
signature->flags|=ASN1_STRING_FLAG_BITS_LEFT;
err:
- memset(&ctx,0,sizeof(ctx));
+ EVP_MD_CTX_cleanup(&ctx);
if (buf_in != NULL)
{ memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
if (buf_out != NULL)