[gnutls-devel] GnuTLS | Ignore unknown algorithms received in compress_certificate extension (!1660)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Oct 21 12:49:13 CEST 2022




Daiki Ueno commented on a discussion on lib/ext/compress_certificate.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1660#note_1144474904

>  	for (i = 0; i < methods_len; ++i) {
>  		num = _gnutls_read_uint16(data + i + i + 1);
>  		methods[i] = _gnutls_compress_certificate_num2method(num);
> -		if (methods[i] == GNUTLS_COMP_UNKNOWN)

Oh, yeah; I now agree with that. In that case I would suggest skipping unknown methods rather than storing it, something like:
```c
size_t k;

for (i = 0, k = 0; i < methods_len; ++i) {
  num = gnutls_read_uint16(data + i + i + 1);
  method = _gnutls_compress_certificate_num2method(num);
  if (method == GNUTLS_COMP_UNKNOWN)
    continue;
  methods[k++] = method;
}

for (i = 0; i < k; i++) {
  ...
}
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1660#note_1144474904
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/20221021/34a273df/attachment.html>


More information about the Gnutls-devel mailing list