You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At message.js:158 there is: const symESKeyPacketlist = this.packets.filterByTag(enums.packet.symEncryptedSessionKey); if (!symESKeyPacketlist) { throw new Error('No symmetrically encrypted session key packet found.'); }
However the implementation filterByTag always returns a new List() (which may be empty).
Even when empty, if (!symESKeyPacketlist) { always evaluates false because empty lists are still truthy
There may be other places in the code that follows this pattern...
The text was updated successfully, but these errors were encountered:
…types (#1289)
Changes:
- Implementation:
- Remove `PacketList.prototype.concat` and `push`
(we solely rely on `Array.push` instead)
- Fix#907 by
correctly handling result of `filterByTag`
- Implement `write()` method for `Trust` and `Marker` packets,
to make them compatible with the `BasePacket` interface
- Types:
- Simplify and updated `PacketList` type definitions
- Fix types for `Packet.tag`, which is `static` since
#1268
- Prevent passing SubkeyPackets where KeyPackets are expected,
and vice versa
At message.js:158 there is:
const symESKeyPacketlist = this.packets.filterByTag(enums.packet.symEncryptedSessionKey); if (!symESKeyPacketlist) { throw new Error('No symmetrically encrypted session key packet found.'); }
However the implementation filterByTag always returns a
new List()
(which may be empty).Even when empty,
if (!symESKeyPacketlist) {
always evaluates false because empty lists are stilltruthy
There may be other places in the code that follows this pattern...
The text was updated successfully, but these errors were encountered: