Better HN
topnewbestaskshowjobs
Log inSign up

ndusart

14 karma · joined Jul 19, 2023 (3y ago) · 7 submissions

Submissions

comment 2y ago · link · parent

From the mentioned specification:

> TCP implementations should follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others.

Better to look in the sources ;)

comment 2y ago · link · parent

Yes, that would be concerning indeed...

The author couldn't tell why he didn't manage to make run the C or python program but figured it is probably the blame of the language for some obscure reasons.

He also mentioned that he should have implemented multithreading in C++ to be comparable with Node, but meh that's probably also not of his concern, let compare them as is ^^`

Also he doesn't mention the actual language of the library used, but that would have voided the interest of the article, so I quite may understand that omission :P

But at the end, nothing can be learned from this and it is hard to believe it is what "research" can produce

comment 2y ago · link · parent

You changed the problem. Postel's law is not about writing the protocol but implementing it.

Sure, protocol should be designed to be as specific as possible but unfortunately these are not always defined up to that point for any good or bad reasons, and we generally are at best just in the implementation side and cannot influence the writing of the protocol, so the Postel's law is the best we can apply to avoid having to cooperate with the rest of the planet.

comment 2y ago · link · parent

Following Postel's law does not mean to accept anything. The received data should still be unambiguous.

You can see that in the case where ASN.1 data need to be exchanged. You could decide to always send them in the DER form (conservative) but accept BER (liberal). BER is still an unambiguous encoding for ASN.1 data but allow several representations for the same data.

The problem with BER mainly lies with cryptographic signature as the signature will only match a specific encoding so that's why DER is used in certificates. But you can still apply Postel's law, you may still accept BER fields when parsing file. If the field has been incorrectly encoded in a varied form which is incompatible with the signature, you will just reject it as you would reject it because it is not standard with DER. But still, you lessen the burden to make sure all parts follow exactly the standards the same way and things tend to work more reliably across server/clients combinations.

comment 2y ago · link · parent

Cookie value can contain `=`, `/` and `+` characters so standard base64 encoding can be used as well :)

comment 2y ago · link · parent

So, just be as conservative as possible when you produce data and as liberal as possible when you receive something. Your code will then require the least cooperation from *any* other code to be compatible with.

Doing otherwise will require cooperation to adjust on the specificities clients expect, and you fall into the trap of the prisoner dilemna.

comment 3y ago · link · parent

Ironically, this supports the message of the article :D