[gnutls-devel] GnuTLS | Read Certificate Transparency (RFC 6962) SCT extension (!1367)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Sat Mar 20 17:11:30 CET 2021




Ander Juaristi commented on a discussion on lib/x509/x509_ext.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1367#note_534040514

> +	ptr += sizeof(uint16_t);
> +	length -= sizeof(uint16_t);
> +	if (sig_length == 0) {
> +		gnutls_assert();
> +		ret = GNUTLS_E_PREMATURE_TERMINATION;
> +		goto cleanup;
> +	}
> +
> +	if (_gnutls_set_datum(&sct->signature, ptr, sig_length) < 0) {
> +		gnutls_assert();
> +		ret = GNUTLS_E_MEMORY_ERROR;
> +		goto cleanup;
> +	}
> +
> +	length -= sig_length;
> +	if (length) {

I've rewritten it as:

```c
if (length != sig_length) {
    gnutls_assert();
    ret = GNUTLS_E_ASN1_DER_OVERFLOW;
    goto cleanup;
}
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1367#note_534040514
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/20210320/9008eaf4/attachment-0001.html>


More information about the Gnutls-devel mailing list