Skip to content

Commit

Permalink
Fully unexport X509_VAL.
Browse files Browse the repository at this point in the history
After https://boringssl-review.googlesource.com/c/boringssl/+/45965,
X509_VAL became largely unusable. While it did still exist as an
ASN1_ITEM and we emitted d2i/i2d/new/free functions, there is no way to
access its contents. Thus, hide it entirely.

Interestingly, although we got that to stick a while ago, I missed that
OpenSSL actually keeps X509_VAL exported, so it's possible we'll find 3p
code that uses this later. Since a standalone X509_VAL isn't especially
useful to construct or encode, this is most likely to come up in code
defining new types with <openssl/asn1t.h>.

Still, if we need to rexport this later (revert this *and* bring back
the struct), it won't be a big deal. Nothing in the public API even
constrains X509 to use X509_VAL.

Update-Note: The last remnants of the now (barely usable) X509_VAL are
no longer exported. It is unlikely anyone was relying on this.

Bug: 425
Change-Id: I90975f2f7ec27753675d2b5fa18b5cc4716319f4
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/50085
Reviewed-by: Adam Langley <[email protected]>
  • Loading branch information
davidben authored and agl committed Oct 21, 2021
1 parent d2d1d3c commit e1049fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions crypto/x509/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ extern "C" {

/* Internal structures. */

struct X509_val_st {
typedef struct X509_val_st {
ASN1_TIME *notBefore;
ASN1_TIME *notAfter;
} /* X509_VAL */;
} X509_VAL;

DECLARE_ASN1_FUNCTIONS(X509_VAL)

struct X509_pubkey_st {
X509_ALGOR *algor;
Expand Down
1 change: 0 additions & 1 deletion include/openssl/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ typedef struct X509_name_st X509_NAME;
typedef struct X509_pubkey_st X509_PUBKEY;
typedef struct X509_req_st X509_REQ;
typedef struct X509_sig_st X509_SIG;
typedef struct X509_val_st X509_VAL;
typedef struct bignum_ctx BN_CTX;
typedef struct bignum_st BIGNUM;
typedef struct bio_method_st BIO_METHOD;
Expand Down
1 change: 0 additions & 1 deletion include/openssl/x509.h
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ OPENSSL_EXPORT X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey,
const EVP_MD *md);

DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
DECLARE_ASN1_FUNCTIONS(X509_VAL)

DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)

Expand Down

0 comments on commit e1049fd

Please sign in to comment.