Remove x509->name.
Every X509 object, when parsed, would pretty-print the subject and stash
the result in x509->name. This field was removed in upstream OpenSSL and
all uses I found have now been fixed. Remove this to reduce unnecessary
work in the X.509 parser.
Update-Note: instead of x509->name, use X509_NAME_oneline and
X509_get_subject_name.
Change-Id: I1d1e69bed7429d59125a8bdea5cbba391cd1028c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/41904
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c
index 010b625..ff0dc34 100644
--- a/crypto/x509/x_x509.c
+++ b/crypto/x509/x_x509.c
@@ -98,7 +98,6 @@
switch (operation) {
case ASN1_OP_NEW_POST:
- ret->name = NULL;
ret->ex_flags = 0;
ret->ex_pathlen = -1;
ret->skid = NULL;
@@ -140,10 +139,6 @@
return 0;
}
- /* TODO(davidben): Remove this field once the few external accesses are
- * removed. */
- OPENSSL_free(ret->name);
- ret->name = X509_NAME_oneline(ret->cert_info->subject, NULL, 0);
break;
}
@@ -158,7 +153,6 @@
GENERAL_NAMES_free(ret->altname);
NAME_CONSTRAINTS_free(ret->nc);
CRYPTO_BUFFER_free(ret->buf);
- OPENSSL_free(ret->name);
break;
}
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index fb6d0bc..d58e3ca 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -230,7 +230,6 @@
X509_ALGOR *sig_alg;
ASN1_BIT_STRING *signature;
CRYPTO_refcount_t references;
- char *name;
CRYPTO_EX_DATA ex_data;
// These contain copies of various extension values
long ex_pathlen;