-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: fix X509Certificate toLegacyObject
PR-URL: #42124 Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
- Loading branch information
Showing
6 changed files
with
61 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,27 +198,28 @@ const der = Buffer.from( | |
|
||
// Verify that legacy encoding works | ||
const legacyObjectCheck = { | ||
subject: 'C=US\n' + | ||
'ST=CA\n' + | ||
'L=SF\n' + | ||
'O=Joyent\n' + | ||
'OU=Node.js\n' + | ||
'CN=agent1\n' + | ||
'[email protected]', | ||
issuer: | ||
'C=US\n' + | ||
'ST=CA\n' + | ||
'L=SF\n' + | ||
'O=Joyent\n' + | ||
'OU=Node.js\n' + | ||
'CN=ca1\n' + | ||
'[email protected]', | ||
infoAccess: | ||
common.hasOpenSSL3 ? | ||
'OCSP - URI:http://ocsp.nodejs.org/\n' + | ||
'CA Issuers - URI:http://ca.nodejs.org/ca.cert' : | ||
'OCSP - URI:http://ocsp.nodejs.org/\n' + | ||
'CA Issuers - URI:http://ca.nodejs.org/ca.cert\n', | ||
subject: Object.assign(Object.create(null), { | ||
C: 'US', | ||
ST: 'CA', | ||
L: 'SF', | ||
O: 'Joyent', | ||
OU: 'Node.js', | ||
CN: 'agent1', | ||
emailAddress: '[email protected]', | ||
}), | ||
issuer: Object.assign(Object.create(null), { | ||
C: 'US', | ||
ST: 'CA', | ||
L: 'SF', | ||
O: 'Joyent', | ||
OU: 'Node.js', | ||
CN: 'ca1', | ||
emailAddress: '[email protected]', | ||
}), | ||
infoAccess: Object.assign(Object.create(null), { | ||
'OCSP - URI': ['http://ocsp.nodejs.org/'], | ||
'CA Issuers - URI': ['http://ca.nodejs.org/ca.cert'] | ||
}), | ||
modulus: 'EF5440701637E28ABB038E5641F828D834C342A9D25EDBB86A2BF' + | ||
'6FBD809CB8E037A98B71708E001242E4DEB54C6164885F599DD87' + | ||
'A23215745955BE20417E33C4D0D1B80C9DA3DE419A2607195D2FB' + | ||
|
@@ -243,9 +244,9 @@ const der = Buffer.from( | |
const legacyObject = x509.toLegacyObject(); | ||
|
||
assert.deepStrictEqual(legacyObject.raw, x509.raw); | ||
assert.strictEqual(legacyObject.subject, legacyObjectCheck.subject); | ||
assert.strictEqual(legacyObject.issuer, legacyObjectCheck.issuer); | ||
assert.strictEqual(legacyObject.infoAccess, legacyObjectCheck.infoAccess); | ||
assert.deepStrictEqual(legacyObject.subject, legacyObjectCheck.subject); | ||
assert.deepStrictEqual(legacyObject.issuer, legacyObjectCheck.issuer); | ||
assert.deepStrictEqual(legacyObject.infoAccess, legacyObjectCheck.infoAccess); | ||
assert.strictEqual(legacyObject.modulus, legacyObjectCheck.modulus); | ||
assert.strictEqual(legacyObject.bits, legacyObjectCheck.bits); | ||
assert.strictEqual(legacyObject.exponent, legacyObjectCheck.exponent); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters