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

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Nov 23 18:28:13 CET 2018


Tom commented on a discussion on lib/auth/cert.c:

> + * don't know how to select the correct one.
> + */
> +static int
> +find_rawpk_cert(gnutls_session_t session,
> +			const gnutls_certificate_credentials_t cred,
> +			const gnutls_pk_algorithm_t* pk_algos,
> +			int pk_algos_length, int* indx)
> +{
> +	unsigned i;
> +	gnutls_pk_algorithm_t pk;
> +
> +	*indx = -1;
> +
> +	// Traverse all certificate credentials
> +	for (i = 0; i < cred->ncerts; i++) {
> +		/* We know that our list length will be 1, therefore we can

I check it such that I can skip all certificates that have a list length other than 1. I don't have to inspect those to find a valid rawpk credential because I know that rawpk credentials always have a list length of 1. So basically it reduces the number of checks in the for loop.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/650#note_119702969
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/20181123/97da585f/attachment-0001.html>


More information about the Gnutls-devel mailing list