Skip to content

Commit

Permalink
Move KU_* back to <openssl/x509v3.h>
Browse files Browse the repository at this point in the history
It turns out NSS and OpenSSL defined the same constants! All this time,
Chromium has inadvertently relied on KU_* being defined in
<openssl/x509v3.h> and not <openssl/x509.h>. Once we merged the two
headers, this broke.

Since we just deprecated these in favor of X509v3_KU_*, just move these
back into <openssl/x509v3.h>.

Change-Id: I93453527f30eee6df7630dc68c052c814aaeda02
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/64607
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
(cherry picked from commit 540fcce9a5a8d92e4686d5d266dc19c91724ea0b)
  • Loading branch information
davidben authored and nebeid committed May 13, 2024
1 parent 7e8abd9 commit 453dbf1
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions include/openssl/x509v3.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

// This header is provided in order to make compiling against code that expects
// OpenSSL easier.
#ifndef OPENSSL_HEADER_X509V3_H
#define OPENSSL_HEADER_X509V3_H

// This header primarily exists in order to make compiling against code that
// expects OpenSSL easier. We have merged this header into <openssl/x509.h>.
// However, due to conflicts, some deprecated symbols are defined here.
#include <openssl/x509.h>

// Deprecated constants.

// The following constants are legacy aliases for |X509v3_KU_*|. They are
// defined here instead of in <openssl/x509.h> because NSS's public headers use
// the same symbols. Some callers have inadvertently relied on the conflicts
// only being defined in this header.
#define KU_DIGITAL_SIGNATURE X509v3_KU_DIGITAL_SIGNATURE
#define KU_NON_REPUDIATION X509v3_KU_NON_REPUDIATION
#define KU_KEY_ENCIPHERMENT X509v3_KU_KEY_ENCIPHERMENT
#define KU_DATA_ENCIPHERMENT X509v3_KU_DATA_ENCIPHERMENT
#define KU_KEY_AGREEMENT X509v3_KU_KEY_AGREEMENT
#define KU_KEY_CERT_SIGN X509v3_KU_KEY_CERT_SIGN
#define KU_CRL_SIGN X509v3_KU_CRL_SIGN
#define KU_ENCIPHER_ONLY X509v3_KU_ENCIPHER_ONLY
#define KU_DECIPHER_ONLY X509v3_KU_DECIPHER_ONLY

#endif // OPENSSL_HEADER_X509V3_H

0 comments on commit 453dbf1

Please sign in to comment.