@@ -4671,30 +4671,7 @@ unsigned int checkIfTLSVersionIsSupported(struct sslCheckOptions *options, unsig
46714671
46724672
46734673 tls_extensions = makeTLSExtensions (options , 1 );
4674- if (tls_version == TLSv1_2 ) {
4675- /* Extension: supported_groups */
4676- bs_append_bytes (tls_extensions , (unsigned char []) {
4677- 0x00 , 0x0a , // Extension: supported_groups (10)
4678- 0x00 , 0x1c , // Extension Length (28)
4679- 0x00 , 0x1a , // Supported Groups List Length (26)
4680- 0x00 , 0x17 , // secp256r1
4681- 0x00 , 0x19 , // secp521r1
4682- 0x00 , 0x1c , // brainpoolP512r1
4683- 0x00 , 0x1b , // brainpoolP384r1
4684- 0x00 , 0x18 , // secp384r1
4685- 0x00 , 0x1a , // brainpoolP256r1
4686- 0x00 , 0x16 , // secp256k1
4687- 0x00 , 0x0e , // sect571r1
4688- 0x00 , 0x0d , // sect571k1
4689- 0x00 , 0x0b , // sect409k1
4690- 0x00 , 0x0c , // sect409r1
4691- 0x00 , 0x09 , // sect283k1
4692- 0x00 , 0x0a , // sect283r1
4693- }, 32 );
4694-
4695- /* Update the length of the extensions. */
4696- tlsExtensionUpdateLength (tls_extensions );
4697- } else if (tls_version == TLSv1_3 ) {
4674+ if (tls_version == TLSv1_3 ) {
46984675 /* Extension: supported_groups */
46994676 bs_append_bytes (tls_extensions , (unsigned char []) {
47004677 0x00 , 0x0a , // Extension: supported_groups (10)
@@ -4718,6 +4695,29 @@ unsigned int checkIfTLSVersionIsSupported(struct sslCheckOptions *options, unsig
47184695 /* Explicitly mark that this is a TLSv1.3 Client Hello. */
47194696 tlsExtensionAddTLSv1_3 (tls_extensions );
47204697
4698+ /* Update the length of the extensions. */
4699+ tlsExtensionUpdateLength (tls_extensions );
4700+ } else {
4701+ /* Extension: supported_groups */
4702+ bs_append_bytes (tls_extensions , (unsigned char []) {
4703+ 0x00 , 0x0a , // Extension: supported_groups (10)
4704+ 0x00 , 0x1c , // Extension Length (28)
4705+ 0x00 , 0x1a , // Supported Groups List Length (26)
4706+ 0x00 , 0x17 , // secp256r1
4707+ 0x00 , 0x19 , // secp521r1
4708+ 0x00 , 0x1c , // brainpoolP512r1
4709+ 0x00 , 0x1b , // brainpoolP384r1
4710+ 0x00 , 0x18 , // secp384r1
4711+ 0x00 , 0x1a , // brainpoolP256r1
4712+ 0x00 , 0x16 , // secp256k1
4713+ 0x00 , 0x0e , // sect571r1
4714+ 0x00 , 0x0d , // sect571k1
4715+ 0x00 , 0x0b , // sect409k1
4716+ 0x00 , 0x0c , // sect409r1
4717+ 0x00 , 0x09 , // sect283k1
4718+ 0x00 , 0x0a , // sect283r1
4719+ }, 32 );
4720+
47214721 /* Update the length of the extensions. */
47224722 tlsExtensionUpdateLength (tls_extensions );
47234723 }
0 commit comments