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

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Mar 27 09:20:36 CET 2020




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

>  	}
> -	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) {

LGTM

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


More information about the Gnutls-devel mailing list