GeezerVison is showing github.com — crypto: fix misleading positional argument · nodejs/node@fd3fb0c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/internal/crypto/cipher.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -112,21 +112,21 @@ function getUIntOption(options, key) { | 112 | 112 | return -1; | 113 | 113 | } | 114 | 114 |
| 115 | | -function createCipherBase(cipher, credential, options, decipher, iv) { | | 115 | +function createCipherBase(cipher, credential, options, isEncrypt, iv) { | 116 | 116 | const authTagLength = getUIntOption(options, 'authTagLength'); | 117 | | - this[kHandle] = new CipherBase(decipher); | | 117 | + this[kHandle] = new CipherBase(isEncrypt); | 118 | 118 | this[kHandle].initiv(cipher, credential, iv, authTagLength); | 119 | 119 | this._decoder = null; | 120 | 120 |
| 121 | 121 | ReflectApply(LazyTransform, this, [options]); | 122 | 122 | } | 123 | 123 |
| 124 | | -function createCipherWithIV(cipher, key, options, decipher, iv) { | | 124 | +function createCipherWithIV(cipher, key, options, isEncrypt, iv) { | 125 | 125 | validateString(cipher, 'cipher'); | 126 | 126 | const encoding = getStringOption(options, 'encoding'); | 127 | 127 | key = prepareSecretKey(key, encoding); | 128 | 128 | iv = iv === null ? null : getArrayBufferOrView(iv, 'iv'); | 129 | | - ReflectApply(createCipherBase, this, [cipher, key, options, decipher, iv]); | | 129 | + ReflectApply(createCipherBase, this, [cipher, key, options, isEncrypt, iv]); | 130 | 130 | } | 131 | 131 |
| 132 | 132 | // The Cipher class is part of the legacy Node.js crypto API. It exposes | |
|