[gnutls-devel] GnuTLS | RFC7250 Raw public keys (!650)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Nov 20 21:57:11 CET 2018


Tom commented on a discussion on lib/pcert.c:

> + * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a
> + *   negative error value.
> + *
> + * Since: 3.6.4
> + **/
> +int gnutls_pcert_import_rawpk(gnutls_pcert_st* pcert,
> +			     gnutls_pubkey_t pubkey, unsigned int flags)
> +{
> +	/* For convenience we reuse the internal pcert structure to hold
> +	 * our raw public key. By doing so we only need one certificate
> +	 * structure that can hold multiple certificate-like credential
> +	 * types.
> +	 */
> +	int ret;
> +
> +	// Check whether a valid pointer to a public key is passed

I've been taught to write down (i.e. comment) the major steps that you are performing in the code to improve readability and ease of reasoning about the code. The rule of thumb is that approx. 50% of good code consists of comments. Of course this number is debatable but in general I think you can rarely have too much comments. In my opinion it doesn't harm and it doesn't influence the resulting binary. Looking at your comments you seem to dislike too much comments. What is your opinion about code comments? What standards should I follow?

BTW: what does the abbreviation "nit" mean?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/650#note_118860803
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20181120/96da29ba/attachment-0001.html>


More information about the Gnutls-devel mailing list