Fix CertificateCompressionAlgorithm to be read as 2-octet-wide
authorAlexander Sosedkin <asosedkin@redhat.com>
Thu, 3 Nov 2022 18:24:15 +0000 (19:24 +0100)
committerTomas Mraz <tomas@openssl.org>
Tue, 8 Nov 2022 15:12:26 +0000 (16:12 +0100)
CLA: trivial

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19600)

ssl/statem/extensions.c

index 601682152a5d6dff70929c268aeec76a0d2b606e..d164719476719a72ddab0485f29cbe67078b1f2f 100644 (file)
@@ -1860,7 +1860,7 @@ int tls_parse_compress_certificate(SSL_CONNECTION *sc, PACKET *pkt, unsigned int
      * The array is 0 (i.e. "none") terminated
      * The preference list only contains supported algorithms
      */
-    while (PACKET_get_1(&supported_comp_algs, &comp)) {
+    while (PACKET_get_net_2(&supported_comp_algs, &comp)) {
         if (tls_comp_in_pref(sc, comp) && !already_set[comp]) {
             sc->ext.compress_certificate_from_peer[j++] = comp;
             already_set[comp] = 1;