aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_digest.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-02-02 00:45:54 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-02-02 00:45:54 +0000
commit88ce56f8c19afca84548ce85bbc9b5dda3c724f9 (patch)
tree3246395c2be795f28d84443d3a193efe6d3a96fb /crypto/asn1/a_digest.c
parent664d83bb23e7e6d30b63f6127b454f7c6dc33da9 (diff)
downloadopenssl-88ce56f8c19afca84548ce85bbc9b5dda3c724f9.tar.gz
Various function for commmon operations.
Diffstat (limited to 'crypto/asn1/a_digest.c')
-rw-r--r--crypto/asn1/a_digest.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto/asn1/a_digest.c b/crypto/asn1/a_digest.c
index 6c12249d2c..3243beadd2 100644
--- a/crypto/asn1/a_digest.c
+++ b/crypto/asn1/a_digest.c
@@ -74,7 +74,6 @@
int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
unsigned char *md, unsigned int *len)
{
- EVP_MD_CTX ctx;
int i;
unsigned char *str,*p;
@@ -83,9 +82,7 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
p=str;
i2d(data,&p);
- EVP_DigestInit(&ctx,type);
- EVP_DigestUpdate(&ctx,str,i);
- EVP_DigestFinal(&ctx,md,len);
+ EVP_Digest(str, i, md, len, type);
OPENSSL_free(str);
return(1);
}
@@ -96,16 +93,13 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
unsigned char *md, unsigned int *len)
{
- EVP_MD_CTX ctx;
int i;
unsigned char *str = NULL;
i=ASN1_item_i2d(asn,&str, it);
if (!str) return(0);
- EVP_DigestInit(&ctx,type);
- EVP_DigestUpdate(&ctx,str,i);
- EVP_DigestFinal(&ctx,md,len);
+ EVP_Digest(str, i, md, len, type);
OPENSSL_free(str);
return(1);
}