mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
crypto: clarify missing cipher error
Explain that a cipher is required when a passphrase is provided. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: https://github.com/nodejs/node/pull/64852 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
1 parent
9c0255bf15
commit
276fe2be45
2 files changed
+5
-2
No files matched your search
@@ -470,7 +470,9 @@ function parseKeyEncoding(enc, keyType, isPublic, objName) {
|
||||
encodingNames[type], 'does not support encryption');
|
||||
}
|
||||
} else if (passphrase !== undefined) {
|
||||
throw new ERR_INVALID_ARG_VALUE(option('cipher', objName), cipher);
|
||||
throw new ERR_INVALID_ARG_VALUE(
|
||||
option('cipher', objName), cipher,
|
||||
'is required when a passphrase is specified');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1014,7 +1014,8 @@ if (!process.features.openssl_is_boringssl) {
|
||||
}, {
|
||||
name: 'TypeError',
|
||||
code: 'ERR_INVALID_ARG_VALUE',
|
||||
message: "The property 'options.cipher' is invalid. Received undefined"
|
||||
message: "The property 'options.cipher' is required when a " +
|
||||
'passphrase is specified. Received undefined',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user