plgd-dev / go-coap

Implementation of CoAP Server & Client in Go
https://coap.technology
Apache License 2.0
443 stars 116 forks source link

Little endian ETag? #345

Closed JosefWN closed 2 years ago

JosefWN commented 2 years ago

According to RFC7252:

All multi-byte integers in this protocol are interpreted in network byte order.

... but it seems GetETag returns a little endian checksum, is this intentional? https://github.com/plgd-dev/go-coap/blob/004711823039d45af60bce6c639835a180f78bdd/message/getETag.go#L42

Danielius1922 commented 2 years ago

That seems really suspicious indeed.

@jkralik: any reason why this is little endian while everything else is big endian?

jkralik commented 2 years ago

Yes this is a bug.

Danielius1922 commented 2 years ago

Thanks for the catch @JosefWN !