Skip to content

Commit

Permalink
tls: represent registeredID numerically always
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tniessen committed Jan 18, 2022
1 parent 56679eb commit 65910c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/crypto/crypto_common.cc
Expand Up @@ -773,11 +773,10 @@ static bool PrintGeneralName(const BIOPointer& out, const GENERAL_NAME* gen) {
#endif
}
} else if (gen->type == GEN_RID) {
// TODO(tniessen): unlike OpenSSL's default implementation, never print the
// OID as text and instead always print its numeric representation, which is
// backward compatible in practice and more future proof (see OBJ_obj2txt).
// Unlike OpenSSL's default implementation, never print the OID as text and
// instead always print its numeric representation.
char oline[256];
i2t_ASN1_OBJECT(oline, sizeof(oline), gen->d.rid);
OBJ_obj2txt(oline, sizeof(oline), gen->d.rid, true);
BIO_printf(out.get(), "Registered ID:%s", oline);
} else if (gen->type == GEN_OTHERNAME) {
// TODO(tniessen): the format that is used here is based on OpenSSL's
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-x509-escaping.js
Expand Up @@ -81,9 +81,9 @@ const { hasOpenSSL3 } = common;
hasOpenSSL3 ?
'DirName:"/C=DE/L=Berlin\\\\/CN=good.example.com"' :
'DirName:/C=DE/L=Berlin/CN=good.example.com',
// TODO(tniessen): even OIDs that are well-known (such as the following,
// which is sha256WithRSAEncryption) should be represented numerically only.
'Registered ID:sha256WithRSAEncryption',
// Even OIDs that are well-known (such as the following, which is
// sha256WithRSAEncryption) should be represented numerically only.
'Registered ID:1.2.840.113549.1.1.11',
// This is an OID that will likely never be assigned to anything, thus
// OpenSSL should not know it.
'Registered ID:1.3.9999.12.34',
Expand Down

0 comments on commit 65910c0

Please sign in to comment.