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>
chromium-5359
David Benjamin 3 years ago committed by Boringssl LUCI CQ
parent 0bfc9b32c4
commit 6bf129213f
  1. 53
      crypto/x509/t_x509.c
  2. 1
      include/openssl/x509.h

@ -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) {

@ -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);

Loading…
Cancel
Save