summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-01-22 09:06:25 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-01-22 09:06:25 +0100
commit7e9b1b05920485a48843698d44257dfd0ac9f9dd (patch)
treea84e75831f2ce3d540b14a93422383fd44fa8079
parent44f33b019e90340e4399d2f950554b921db63ade (diff)
downloadgnutls-7e9b1b05920485a48843698d44257dfd0ac9f9dd.tar.gz
added sub-section on selecting the right return value [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--CONTRIBUTING.md7
1 files changed, 7 insertions, 0 deletions
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()