Skip to content

Commit

Permalink
crypto: rename X509_NAME_FLAGS
Browse files Browse the repository at this point in the history
Rename X509_NAME_FLAGS to kX509NameFlagsMultiline to better align with
the naming conventions we use for constexpr values, to distinguish it
from OpenSSL's built-in X509 constants, and to clarify what specific
X509 name flags the constant represents.

PR-URL: #42001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
tniessen committed Feb 17, 2022
1 parent 5edad38 commit 19370b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/crypto/crypto_common.cc
Expand Up @@ -41,7 +41,7 @@ using v8::Undefined;
using v8::Value;

namespace crypto {
static constexpr int X509_NAME_FLAGS =
static constexpr int kX509NameFlagsMultiline =
ASN1_STRFLGS_ESC_2253 |
ASN1_STRFLGS_ESC_CTRL |
ASN1_STRFLGS_UTF8_CONVERT |
Expand Down Expand Up @@ -940,7 +940,11 @@ MaybeLocal<Value> GetIssuerString(
const BIOPointer& bio,
X509* cert) {
X509_NAME* issuer_name = X509_get_issuer_name(cert);
if (X509_NAME_print_ex(bio.get(), issuer_name, 0, X509_NAME_FLAGS) <= 0) {
if (X509_NAME_print_ex(
bio.get(),
issuer_name,
0,
kX509NameFlagsMultiline) <= 0) {
USE(BIO_reset(bio.get()));
return Undefined(env->isolate());
}
Expand All @@ -956,7 +960,7 @@ MaybeLocal<Value> GetSubject(
bio.get(),
X509_get_subject_name(cert),
0,
X509_NAME_FLAGS) <= 0) {
kX509NameFlagsMultiline) <= 0) {
USE(BIO_reset(bio.get()));
return Undefined(env->isolate());
}
Expand Down

0 comments on commit 19370b3

Please sign in to comment.