Remove X509_ocspid_print.
This was originally added for the openssl command-line utility and
otherwise is not very useful. I found no callers, so drop it.
Update-Note: An unused function was removed.
Change-Id: I12aa314fd3d8f1dad79eb5a07e0dea662dd9b4a8
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53328
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index 4db682d..6694e3d 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -269,59 +269,6 @@
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 acb20f4..069df26 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -1797,7 +1797,6 @@
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);