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 <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
tniessen authored and bengl committed Feb 21, 2022
1 parent 047d4de commit ce99600
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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 @@ -988,7 +988,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 @@ -1004,7 +1008,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 ce99600

Please sign in to comment.