Throw on parse errors in integrity protected encrypted packets

This commit is contained in:
Daniel Huigens 2018-10-05 12:40:05 +02:00
parent a6e3ada438
commit bc6118980f

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);