From 7e9b1b05920485a48843698d44257dfd0ac9f9dd Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 22 Jan 2018 09:06:25 +0100 Subject: added sub-section on selecting the right return value [ci skip] Signed-off-by: Nikos Mavrogiannopoulos --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7947f7e6d2..b8448c0412 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -169,6 +169,13 @@ from boolean functions to both the developer and the compiler. Note that in the past the 'unsigned' type was used to distinguish boolean functions and several of these still exist. +## Selecting the right return value + +When selecting the return value for a TLS protocol parsing function +a suggested approach is to check which alert fits best on that error +(see `alert.c`), and then select from the error codes which are mapped +to that alert (see `gnutls_error_to_alert()`). For more generic parsing +errors consider using the `GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER`. # Usage of assert() -- cgit v1.2.1