diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-02-02 01:45:54 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-02-02 01:45:54 +0100 |
commit | 88ce56f8c19afca84548ce85bbc9b5dda3c724f9 (patch) | |
tree | 3246395c2be795f28d84443d3a193efe6d3a96fb /crypto/ocsp/ocsp_lib.c | |
parent | Tidy up the mess in bss_sock.c and bss_fd.c (diff) | |
download | openssl-88ce56f8c19afca84548ce85bbc9b5dda3c724f9.tar.xz openssl-88ce56f8c19afca84548ce85bbc9b5dda3c724f9.zip |
Various function for commmon operations.
Diffstat (limited to 'crypto/ocsp/ocsp_lib.c')
-rw-r--r-- | crypto/ocsp/ocsp_lib.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/crypto/ocsp/ocsp_lib.c b/crypto/ocsp/ocsp_lib.c index bdd4cfccff..825d023e05 100644 --- a/crypto/ocsp/ocsp_lib.c +++ b/crypto/ocsp/ocsp_lib.c @@ -82,7 +82,7 @@ OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer) #endif iname = X509_get_issuer_name(subject); serial = X509_get_serialNumber(subject); - ikey = issuer->cert_info->key->public_key; + ikey = X509_get0_pubkey_bitstr(issuer); return OCSP_cert_id_new(dgst, iname, ikey, serial); } @@ -97,7 +97,6 @@ OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, X509_ALGOR *alg; OCSP_CERTID *cid = NULL; unsigned char md[EVP_MAX_MD_SIZE]; - EVP_MD_CTX ctx; if (!(cid = OCSP_CERTID_new())) goto err; @@ -116,9 +115,7 @@ OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, if (!(ASN1_OCTET_STRING_set(cid->issuerNameHash, md, i))) goto err; /* Calculate the issuerKey hash, excluding tag and length */ - EVP_DigestInit(&ctx,dgst); - EVP_DigestUpdate(&ctx,issuerKey->data, issuerKey->length); - EVP_DigestFinal(&ctx,md,&i); + EVP_Digest(issuerKey->data, issuerKey->length, md, &i, dgst); if (!(ASN1_OCTET_STRING_set(cid->issuerKeyHash, md, i))) goto err; @@ -186,7 +183,6 @@ OCSP_BASICRESP *OCSP_basic_response_new(int type, X509* cert) { time_t t; OCSP_RESPID *rid; - ASN1_BIT_STRING *bs; OCSP_BASICRESP *rsp = NULL; unsigned char md[SHA_DIGEST_LENGTH]; @@ -205,9 +201,7 @@ OCSP_BASICRESP *OCSP_basic_response_new(int type, X509* cert) /* SHA-1 hash of responder's public key * (excluding the tag and length fields) */ - bs = cert->cert_info->key->public_key; - SHA1(ASN1_STRING_data((ASN1_STRING*)bs), - ASN1_STRING_length((ASN1_STRING*)bs), md); + X509_pubkey_digest(cert, EVP_sha1(), md, NULL); if (!(rid->value.byKey = ASN1_OCTET_STRING_new())) goto err; if (!(ASN1_OCTET_STRING_set(rid->value.byKey, |