From 8092708d446f709324fa935c588da9358ad5c336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 18 Feb 2022 00:11:46 +0100 Subject: [PATCH] crypto: rename X509_NAME_FLAGS 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: https://github.com/nodejs/node/pull/42001 Reviewed-By: Anna Henningsen Reviewed-By: Antoine du Hamel --- src/crypto/crypto_common.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index f830da2cfba18a..2234cb151afcf7 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -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 | @@ -988,7 +988,11 @@ MaybeLocal 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()); } @@ -1004,7 +1008,7 @@ MaybeLocal GetSubject( bio.get(), X509_get_subject_name(cert), 0, - X509_NAME_FLAGS) <= 0) { + kX509NameFlagsMultiline) <= 0) { USE(BIO_reset(bio.get())); return Undefined(env->isolate()); }