aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-06-19 22:30:40 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-06-19 22:30:40 +0000
commit323f289c480b0a8eb15ed3be2befbcc0f86e8904 (patch)
treea8f18dde28ce3c77b7bff50c2b45a44c556dfed4 /crypto/asn1
parenta45e4a5537e009761652db0d9aa1ef28b1ce8937 (diff)
downloadopenssl-323f289c480b0a8eb15ed3be2befbcc0f86e8904.tar.gz
Change all calls to low level digest routines in the library and
applications to use EVP. Add missing calls to HMAC_cleanup() and don't assume HMAC_CTX can be copied using memcpy(). Note: this is almost identical to the patch submitted to openssl-dev by Verdon Walker <VWalker@novell.com> except some redundant EVP_add_digest_()/EVP_cleanup() calls were removed and some changes made to avoid compiler warnings.
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/t_x509.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c
index 17ed9f2f7f..0bba0861d1 100644
--- a/crypto/asn1/t_x509.c
+++ b/crypto/asn1/t_x509.c
@@ -259,7 +259,6 @@ int X509_ocspid_print (BIO *bp, X509 *x)
unsigned char *dertmp;
int derlen;
int i;
- SHA_CTX SHA1buf ;
unsigned char SHA1md[SHA_DIGEST_LENGTH];
/* display the hash of the subject as it would appear
@@ -271,9 +270,7 @@ int X509_ocspid_print (BIO *bp, X509 *x)
goto err;
i2d_X509_NAME(x->cert_info->subject, &dertmp);
- SHA1_Init(&SHA1buf);
- SHA1_Update(&SHA1buf, der, derlen);
- SHA1_Final(SHA1md,&SHA1buf);
+ EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1());
for (i=0; i < SHA_DIGEST_LENGTH; i++)
{
if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) goto err;
@@ -286,10 +283,8 @@ int X509_ocspid_print (BIO *bp, X509 *x)
if (BIO_printf(bp,"\n Public key OCSP hash: ") <= 0)
goto err;
- SHA1_Init(&SHA1buf);
- SHA1_Update(&SHA1buf, x->cert_info->key->public_key->data,
- x->cert_info->key->public_key->length);
- SHA1_Final(SHA1md,&SHA1buf);
+ EVP_Digest(x->cert_info->key->public_key->data,
+ x->cert_info->key->public_key->length, SHA1md, NULL, EVP_sha1());
for (i=0; i < SHA_DIGEST_LENGTH; i++)
{
if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0)