diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c index 4db682d9f..6694e3d12 100644 --- a/crypto/x509/t_x509.c +++ b/crypto/x509/t_x509.c @@ -269,59 +269,6 @@ err: return ret; } -int X509_ocspid_print(BIO *bp, X509 *x) { - unsigned char *der = NULL; - unsigned char *dertmp; - int derlen; - int i; - unsigned char SHA1md[SHA_DIGEST_LENGTH]; - - // display the hash of the subject as it would appear in OCSP requests - if (BIO_printf(bp, " Subject OCSP hash: ") <= 0) { - goto err; - } - derlen = i2d_X509_NAME(x->cert_info->subject, NULL); - if ((der = dertmp = (unsigned char *)OPENSSL_malloc(derlen)) == NULL) { - goto err; - } - i2d_X509_NAME(x->cert_info->subject, &dertmp); - - if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL)) { - goto err; - } - for (i = 0; i < SHA_DIGEST_LENGTH; i++) { - if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) { - goto err; - } - } - OPENSSL_free(der); - der = NULL; - - // display the hash of the public key as it would appear in OCSP requests - if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0) { - goto err; - } - - if (!EVP_Digest(x->cert_info->key->public_key->data, - x->cert_info->key->public_key->length, SHA1md, NULL, - EVP_sha1(), NULL)) { - goto err; - } - for (i = 0; i < SHA_DIGEST_LENGTH; i++) { - if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) { - goto err; - } - } - BIO_printf(bp, "\n"); - - return 1; -err: - if (der != NULL) { - OPENSSL_free(der); - } - return 0; -} - int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig) { if (BIO_puts(bp, " Signature Algorithm: ") <= 0) { diff --git a/include/openssl/x509.h b/include/openssl/x509.h index acb20f44e..069df2655 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -1797,7 +1797,6 @@ OPENSSL_EXPORT int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, OPENSSL_EXPORT int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag, unsigned long cflag); OPENSSL_EXPORT int X509_print(BIO *bp, X509 *x); -OPENSSL_EXPORT int X509_ocspid_print(BIO *bp, X509 *x); OPENSSL_EXPORT int X509_CRL_print(BIO *bp, X509_CRL *x); OPENSSL_EXPORT int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag);