Skip to content

Commit acc6150

Browse files
davidbennebeid
authored andcommittedSep 12, 2022
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 <[email protected]> Commit-Queue: David Benjamin <[email protected]> (cherry picked from commit 6bf129213fc02cf7be5710fb7b5e94ffc0637b39)
1 parent 4ebe5da commit acc6150

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed
 

‎crypto/x509/t_x509.c

-53
Original file line numberDiff line numberDiff line change
@@ -269,59 +269,6 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
269269
return ret;
270270
}
271271

272-
int X509_ocspid_print(BIO *bp, X509 *x) {
273-
unsigned char *der = NULL;
274-
unsigned char *dertmp;
275-
int derlen;
276-
int i;
277-
unsigned char SHA1md[SHA_DIGEST_LENGTH];
278-
279-
// display the hash of the subject as it would appear in OCSP requests
280-
if (BIO_printf(bp, " Subject OCSP hash: ") <= 0) {
281-
goto err;
282-
}
283-
derlen = i2d_X509_NAME(x->cert_info->subject, NULL);
284-
if ((der = dertmp = (unsigned char *)OPENSSL_malloc(derlen)) == NULL) {
285-
goto err;
286-
}
287-
i2d_X509_NAME(x->cert_info->subject, &dertmp);
288-
289-
if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL)) {
290-
goto err;
291-
}
292-
for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
293-
if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) {
294-
goto err;
295-
}
296-
}
297-
OPENSSL_free(der);
298-
der = NULL;
299-
300-
// display the hash of the public key as it would appear in OCSP requests
301-
if (BIO_printf(bp, "\n Public key OCSP hash: ") <= 0) {
302-
goto err;
303-
}
304-
305-
if (!EVP_Digest(x->cert_info->key->public_key->data,
306-
x->cert_info->key->public_key->length, SHA1md, NULL,
307-
EVP_sha1(), NULL)) {
308-
goto err;
309-
}
310-
for (i = 0; i < SHA_DIGEST_LENGTH; i++) {
311-
if (BIO_printf(bp, "%02X", SHA1md[i]) <= 0) {
312-
goto err;
313-
}
314-
}
315-
BIO_printf(bp, "\n");
316-
317-
return 1;
318-
err:
319-
if (der != NULL) {
320-
OPENSSL_free(der);
321-
}
322-
return 0;
323-
}
324-
325272
int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
326273
const ASN1_STRING *sig) {
327274
if (BIO_puts(bp, " Signature Algorithm: ") <= 0) {

‎include/openssl/x509.h

-1
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,6 @@ OPENSSL_EXPORT int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
17971797
OPENSSL_EXPORT int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
17981798
unsigned long cflag);
17991799
OPENSSL_EXPORT int X509_print(BIO *bp, X509 *x);
1800-
OPENSSL_EXPORT int X509_ocspid_print(BIO *bp, X509 *x);
18011800
OPENSSL_EXPORT int X509_CRL_print(BIO *bp, X509_CRL *x);
18021801
OPENSSL_EXPORT int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
18031802
unsigned long cflag);

0 commit comments

Comments
 (0)
Please sign in to comment.