-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: improve the code in test-crypto-rsa-dsa #10681
Conversation
There are five instances of |
assert.ok(rsaSign); | ||
assert.ok(rsaVerify); | ||
|
||
const expectingSig = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you name this expectedSignature
?
key: rsaKeyPem, | ||
padding: padding | ||
}, encryptedBuffer); | ||
assert.equal(input, decryptedBuffer.toString()); | ||
assert.strictEqual(decryptedBuffer.toString(), input.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: isn't it better to compare the two buffers directly instead of their string representation?
assert.deepStrictEqual(decryptedBuffer, input);
or
assert(decryptedBuffer.equals(input));
common.fixturesDir + '/test_dsa_privkey_encrypted.pem', 'ascii'); | ||
|
||
const decryptError = new RegExp('^Error: error:06065064:digital envelope ' + | ||
'routines:EVP_DecryptFinal_ex:bad decrypt$'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think should be shifted to the left by 2 spaces.
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws
@lpinca , did as suggested |
Landed in 85a9034. |
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs#10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This will need backport PRs in order to land on v6 or v4 |
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10681 Backport-PR-URL: #13785 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10681 Backport-PR-URL: #13785 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: #10681 Backport-PR-URL: #13785 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* use const and let instead of var * use assert.strictEqual or assert.strictDeepEqual instead of assert.equal * use arrow functions * swap assertions arguments to match the standard * validate the error for assert.throws PR-URL: nodejs/node#10681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test