Merge pull request #779 from twiss/throw-parse-errors

Throw on parse errors in integrity protected encrypted packets
This commit is contained in:
Sanjana Rajan 2018-10-10 18:16:59 +02:00 committed by GitHub
commit 1e3f223e8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,10 +53,9 @@ List.prototype.read = async function (bytes) {
await packet.read(parsed.packet); await packet.read(parsed.packet);
await writer.write(packet); await writer.write(packet);
} catch (e) { } catch (e) {
if (!config.tolerant || if (!config.tolerant || packetParser.supportsStreaming(parsed.tag)) {
parsed.tag === enums.packet.symmetricallyEncrypted || // The packets that support streaming also happen to be the same
parsed.tag === enums.packet.literal || // ones we want to throw on parse errors for.
parsed.tag === enums.packet.compressed) {
await writer.abort(e); await writer.abort(e);
} }
util.print_debug_error(e); util.print_debug_error(e);