Rantanen / node-dtls

JavaScript DTLS implementation for Node.js
ISC License
58 stars 15 forks source link

DtlsCompressed sequence_number size should be 48/8 #7

Closed brycekahle closed 9 years ago

brycekahle commented 9 years ago

To match DtlsPlaintext https://github.com/Rantanen/node-dtls/blob/master/packets/DtlsPlaintext.js#L23 DtlsCompressed sequence_number size should be 48/8 https://github.com/Rantanen/node-dtls/blob/master/packets/DtlsCompressed.js#L19

Rantanen commented 9 years ago

DtlsCompressed and DtlsCiphertext were never used. The byte structure of these packets is essentially the same as DtlsPlaintext.

Instead of using the DtlsCompressed and DtlsCiphertext packet formats, the DtlsRecordLayer reads the incoming packet as DtlsPlaintext and then based on the epoch and sequence numbers (which are in the same location for all the incoming packets) it'll figure out whether the packet requires decrypting/decrompression. Same happens for outgoing packets.

I'll close the issue by removing the obsolete packets from the code base.