Skip to content

Commit 65910c0

Browse files
committed
tls: represent registeredID numerically always
Refs: 466e541 PR-URL: #41561 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 56679eb commit 65910c0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/crypto/crypto_common.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,10 @@ static bool PrintGeneralName(const BIOPointer& out, const GENERAL_NAME* gen) {
773773
#endif
774774
}
775775
} else if (gen->type == GEN_RID) {
776-
// TODO(tniessen): unlike OpenSSL's default implementation, never print the
777-
// OID as text and instead always print its numeric representation, which is
778-
// backward compatible in practice and more future proof (see OBJ_obj2txt).
776+
// Unlike OpenSSL's default implementation, never print the OID as text and
777+
// instead always print its numeric representation.
779778
char oline[256];
780-
i2t_ASN1_OBJECT(oline, sizeof(oline), gen->d.rid);
779+
OBJ_obj2txt(oline, sizeof(oline), gen->d.rid, true);
781780
BIO_printf(out.get(), "Registered ID:%s", oline);
782781
} else if (gen->type == GEN_OTHERNAME) {
783782
// TODO(tniessen): the format that is used here is based on OpenSSL's

test/parallel/test-x509-escaping.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ const { hasOpenSSL3 } = common;
8181
hasOpenSSL3 ?
8282
'DirName:"/C=DE/L=Berlin\\\\/CN=good.example.com"' :
8383
'DirName:/C=DE/L=Berlin/CN=good.example.com',
84-
// TODO(tniessen): even OIDs that are well-known (such as the following,
85-
// which is sha256WithRSAEncryption) should be represented numerically only.
86-
'Registered ID:sha256WithRSAEncryption',
84+
// Even OIDs that are well-known (such as the following, which is
85+
// sha256WithRSAEncryption) should be represented numerically only.
86+
'Registered ID:1.2.840.113549.1.1.11',
8787
// This is an OID that will likely never be assigned to anything, thus
8888
// OpenSSL should not know it.
8989
'Registered ID:1.3.9999.12.34',

0 commit comments

Comments
 (0)