Skip to content

Conversation

@Leko
Copy link
Contributor

@LekoLeko commented Dec 4, 2017

I added these tests:

Cipheriv
  • Call constructor without new keyword
  • Call constructor with cipher is not string
  • Call constructor with cipher is string and key is not string
  • Call constructor with cipher is strong, key is string and iv is not string
Decipheriv
  • Call constructor without new keyword
  • Call constructor with cipher is not string
  • Call constructor with cipher is string and key is not string
  • Call constructor with cipher is strong, key is string and iv is not string

Current coverage is here: https://coverage.nodejs.org/coverage-06e1b0386196f8f8/root/internal/crypto/cipher.js.html

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

- Call constructor without new keyword - Call constructor with cipher is not string - Call constructor with cipher is string and key is not string - Call constructor with cipher is strong, key is string and iv is not string
- Call constructor without new keyword - Call constructor with cipher is not string - Call constructor with cipher is string and key is not string - Call constructor with cipher is strong, key is string and iv is not string
@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Dec 4, 2017
@mscdexmscdex added the crypto Issues and PRs related to the crypto subsystem. label Dec 4, 2017
@maclover7
Copy link
Contributor

Just a general note, is there any advantage to not using the createDecipheriv/createCipheriv methods like the other tests in the file, for consistency?

@Leko
Copy link
ContributorAuthor

Leko commented Dec 5, 2017

@maclover7 Thank you for your review.
I lost the point of consistency. I thought it would be better to use a factory.
I updated new XXX -> crypto.createXXX.

Copy link
Contributor

@maclover7maclover7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One quick nit then LGTM

constkey='123456789012345678901234';
constiv='12345678';

constinstance=Cipheriv('des-ede3-cbc',key,iv);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createCipheriv

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line cannot use createCipheriv because createCipheriv calls constructor with new keyword always.
I want to test call constructor without new keyword.

@maclover7
Copy link
Contributor

@maclover7maclover7 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 7, 2017
@apapirovski
Copy link
Contributor

Landed in 6707903

apapirovski pushed a commit that referenced this pull request Dec 8, 2017
PR-URL: #17458 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
@LekoLeko deleted the enhance_coverage_crypto_cipheriv branch December 8, 2017 15:49
@MylesBorins
Copy link
Contributor

This relies on changes in #16527

Setting as don't land for <=v9.x

@addaleaxaddaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 13, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cryptoIssues and PRs related to the crypto subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@Leko@maclover7@apapirovski@MylesBorins@jasnell@lpinca@BridgeAR@mscdex@addaleax@nodejs-github-bot