mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-03 16:00:26 +00:00
Rename config.unsafe_stream to allow_unauthenticated_stream
This commit is contained in:
@@ -93,6 +93,11 @@ export default {
|
||||
* @property {Boolean} ignore_mdc_error Fail on decrypt if message is not integrity protected
|
||||
*/
|
||||
ignore_mdc_error: false,
|
||||
/**
|
||||
* @memberof module:config
|
||||
* @property {Boolean} allow_unauthenticated_stream Stream unauthenticated data before integrity has been checked
|
||||
*/
|
||||
allow_unauthenticated_stream: false,
|
||||
/**
|
||||
* @memberof module:config
|
||||
* @property {Boolean} checksum_required Do not throw error when armor is missing a checksum
|
||||
|
||||
@@ -148,7 +148,7 @@ SymEncryptedIntegrityProtected.prototype.decrypt = async function (sessionKeyAlg
|
||||
});
|
||||
let packetbytes = stream.slice(bytes, 0, -2);
|
||||
packetbytes = stream.concat([packetbytes, stream.fromAsync(() => verifyHash)]);
|
||||
if (!util.isStream(encrypted) || !config.unsafe_stream) {
|
||||
if (!util.isStream(encrypted) || !config.allow_unauthenticated_stream) {
|
||||
packetbytes = await stream.readToEnd(packetbytes);
|
||||
}
|
||||
await this.packets.read(packetbytes);
|
||||
|
||||
Reference in New Issue
Block a user