[gnutls-devel] GnuTLS | WIP: Compare DNs by comparing their string representations (!1223)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Mar 24 20:15:35 CET 2020




Nikos Mavrogiannopoulos started a new discussion on lib/x509/dn.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1223#note_310740001

>  	}
> -	if (memcmp(dn1->data, dn2->data, dn2->size) != 0) {
> +
> +	ret = gnutls_x509_rdn_get2(dn2, &str2, 0);
> +	if (ret < 0) {
>  		gnutls_assert();
> +		_gnutls_free_datum(&str1);
>  		return 0;
>  	}
> -	return 1;		/* they match */
> +
> +	if (str1.size != str2.size) {
> +		ret = 0;
> +		goto cleanup;
> +	}
> +	if (memcmp(str1.data, str2.data, str2.size) != 0) {

I think few unit tests that check this comparison should be necessary.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1223#note_310740001
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/20200324/ba630847/attachment.html>


More information about the Gnutls-devel mailing list