Skip to content

Commit efa76a8

Browse files
committed
fixup! Add support for integrity-only cipher suites for TLS v1.3
1 parent 5189582 commit efa76a8

File tree

10 files changed

+41
-20
lines changed

10 files changed

+41
-20
lines changed

.github/workflows/run-checker-merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
no-srp,
3434
no-srtp,
3535
no-ts,
36+
no-integrity-only-ciphers,
3637
enable-weak-ssl-ciphers,
3738
enable-zlib,
3839
]

CHANGES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ OpenSSL 3.4
4747

4848
*Tim Perry*
4949

50-
* Added to TLS v1.3 support for integrity-only cipher suites
51-
TLS_SHA256_SHA256 and TLS_SHA384_SHA384, as defined in RFC 9150.
50+
* Added support for integrity-only cipher suites TLS_SHA256_SHA256 and
51+
TLS_SHA384_SHA384 in TLS 1.3, as defined in RFC 9150.
5252

5353
This work was sponsored by Siemens AG.
5454

Configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ my @disablables = (
528528
"thread-pool",
529529
"threads",
530530
"tls",
531-
"tls1_3-integrity-only_ciphers",
531+
"integrity-only-ciphers",
532532
"trace",
533533
"ts",
534534
"ubsan",

doc/man1/openssl-ciphers.pod.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ Note: the CBC modes mentioned in this RFC are not supported.
745745

746746
Note: these ciphers are purely HMAC based and do not provide any confidentiality
747747
and thus are disabled by default.
748-
These ciphers are available at security level 0.
748+
These ciphers are only available at security level 0.
749749

750750
=head2 Older names used by OpenSSL
751751

@@ -811,7 +811,7 @@ The B<-convert> option was added in OpenSSL 1.1.1.
811811
Support for standard IANA names in cipher lists was added in
812812
OpenSSL 3.2.0.
813813

814-
The support for TLS v1.3 integrity-only cipher suites was added in OpenSSL 3.3.
814+
The support for TLS v1.3 integrity-only cipher suites was added in OpenSSL 3.4.
815815

816816
=head1 COPYRIGHT
817817

doc/man3/SSL_CTX_set_cipher_list.pod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ ciphersuite names in order of preference. Valid TLSv1.3 ciphersuite names are:
5050

5151
=item TLS_AES_128_CCM_8_SHA256
5252

53-
=item TLS_SHA384_SHA384 - integrity-only!
53+
=item TLS_SHA384_SHA384 - integrity-only
5454

55-
=item TLS_SHA256_SHA256 - integrity-only!
55+
=item TLS_SHA256_SHA256 - integrity-only
5656

5757
=back
5858

ssl/record/methods/tls13_meth.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ static int tls13_set_crypto_state(OSSL_RECORD_LAYER *rl, int level,
3131
int enc = (rl->direction == OSSL_RECORD_DIRECTION_WRITE) ? 1 : 0;
3232

3333
rl->iv = OPENSSL_malloc(ivlen);
34-
if (rl->iv == NULL) {
35-
ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
34+
if (rl->iv == NULL)
3635
return OSSL_RECORD_RETURN_FATAL;
37-
}
3836

3937
rl->nonce = OPENSSL_malloc(ivlen);
40-
if (rl->nonce == NULL) {
41-
ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
38+
if (rl->nonce == NULL)
4239
return OSSL_RECORD_RETURN_FATAL;
43-
}
40+
4441
memcpy(rl->iv, iv, ivlen);
4542

4643
/* Integrity only */

ssl/s3_lib.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static SSL_CIPHER tls13_ciphers[] = {
113113
64, /* CCM8 uses a short tag, so we have a low security strength */
114114
128,
115115
},
116-
#ifndef OPENSSL_NO_TLS1_3_INTEGRITY_ONLY_CIPHERS
116+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
117117
{
118118
1,
119119
TLS1_3_RFC_SHA256_SHA256,
@@ -159,6 +159,7 @@ static SSL_CIPHER tls13_ciphers[] = {
159159
* Weak ciphers
160160
*/
161161
static SSL_CIPHER ssl3_ciphers[] = {
162+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
162163
{
163164
1,
164165
SSL3_TXT_RSA_NULL_MD5,
@@ -191,6 +192,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
191192
0,
192193
0,
193194
},
195+
#endif
194196
#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
195197
{
196198
1,
@@ -385,6 +387,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
385387
256,
386388
256,
387389
},
390+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
388391
{
389392
1,
390393
TLS1_TXT_RSA_WITH_NULL_SHA256,
@@ -401,6 +404,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
401404
0,
402405
0,
403406
},
407+
#endif
404408
{
405409
1,
406410
TLS1_TXT_RSA_WITH_AES_128_SHA256,
@@ -977,6 +981,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
977981
64, /* CCM8 uses a short tag, so we have a low security strength */
978982
256,
979983
},
984+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
980985
{
981986
1,
982987
TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
@@ -993,6 +998,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
993998
0,
994999
0,
9951000
},
1001+
#endif
9961002
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
9971003
{
9981004
1,
@@ -1043,6 +1049,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
10431049
256,
10441050
256,
10451051
},
1052+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
10461053
{
10471054
1,
10481055
TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
@@ -1059,6 +1066,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
10591066
0,
10601067
0,
10611068
},
1069+
#endif
10621070
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
10631071
{
10641072
1,
@@ -1109,6 +1117,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
11091117
256,
11101118
256,
11111119
},
1120+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
11121121
{
11131122
1,
11141123
TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
@@ -1125,6 +1134,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
11251134
0,
11261135
0,
11271136
},
1137+
#endif
11281138
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
11291139
{
11301140
1,
@@ -1303,6 +1313,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
13031313
256,
13041314
256,
13051315
},
1316+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
13061317
{
13071318
1,
13081319
TLS1_TXT_PSK_WITH_NULL_SHA,
@@ -1351,6 +1362,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
13511362
0,
13521363
0,
13531364
},
1365+
#endif
13541366
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
13551367
{
13561368
1,
@@ -1629,6 +1641,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
16291641
256,
16301642
256,
16311643
},
1644+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
16321645
{
16331646
1,
16341647
TLS1_TXT_PSK_WITH_NULL_SHA256,
@@ -1661,6 +1674,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
16611674
0,
16621675
0,
16631676
},
1677+
#endif
16641678
{
16651679
1,
16661680
TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256,
@@ -1693,6 +1707,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
16931707
256,
16941708
256,
16951709
},
1710+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
16961711
{
16971712
1,
16981713
TLS1_TXT_DHE_PSK_WITH_NULL_SHA256,
@@ -1725,6 +1740,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
17251740
0,
17261741
0,
17271742
},
1743+
#endif
17281744
{
17291745
1,
17301746
TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256,
@@ -1757,6 +1773,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
17571773
256,
17581774
256,
17591775
},
1776+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
17601777
{
17611778
1,
17621779
TLS1_TXT_RSA_PSK_WITH_NULL_SHA256,
@@ -1789,6 +1806,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
17891806
0,
17901807
0,
17911808
},
1809+
#endif
17921810
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
17931811
{
17941812
1,
@@ -1871,6 +1889,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
18711889
256,
18721890
256,
18731891
},
1892+
#ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
18741893
{
18751894
1,
18761895
TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA,
@@ -1919,7 +1938,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
19191938
0,
19201939
0,
19211940
},
1922-
1941+
#endif
19231942
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
19241943
{
19251944
1,
@@ -2646,6 +2665,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
26462665
256,
26472666
256,
26482667
},
2668+
# ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
26492669
{
26502670
1,
26512671
"GOST2001-NULL-GOST94",
@@ -2662,6 +2682,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
26622682
0,
26632683
0,
26642684
},
2685+
# endif
26652686
{
26662687
1,
26672688
"IANA-GOST2012-GOST8912-GOST8912",
@@ -2694,6 +2715,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
26942715
256,
26952716
256,
26962717
},
2718+
# ifndef OPENSSL_NO_INTEGRITY_ONLY_CIPHERS
26972719
{
26982720
1,
26992721
"GOST2012-NULL-GOST12",
@@ -2710,6 +2732,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
27102732
0,
27112733
0,
27122734
},
2735+
# endif
27132736
{
27142737
1,
27152738
"GOST2012-KUZNYECHIK-KUZNYECHIKOMAC",

test/quicapitest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static int test_cipher_find(void)
343343
{ TLS13_CHACHA20_POLY1305_SHA256_BYTES, 1 },
344344
{ TLS13_AES_128_CCM_SHA256_BYTES, 0 },
345345
{ TLS13_AES_128_CCM_8_SHA256_BYTES, 0 },
346-
#if !defined(OPENSSL_NO_TLS1_3_INTEGRITY_ONLY_CIPHERS)
346+
#if !defined(OPENSSL_NO_INTEGRITY_ONLY_CIPHERS)
347347
{ TLS13_SHA256_SHA256_BYTES, 0 },
348348
{ TLS13_SHA384_SHA384_BYTES, 0 }
349349
#endif

test/recipes/30-test_evp_data/evpciph_null_hmac.txt

Whitespace-only changes.

test/sslapitest.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3919,7 +3919,7 @@ static const char *ciphersuites[] = {
39193919
#else
39203920
NULL,
39213921
#endif
3922-
#if !defined(OPENSSL_NO_TLS1_3_INTEGRITY_ONLY_CIPHERS)
3922+
#if !defined(OPENSSL_NO_INTEGRITY_ONLY_CIPHERS)
39233923
"TLS_SHA256_SHA256",
39243924
"TLS_SHA384_SHA384"
39253925
#endif
@@ -4453,7 +4453,7 @@ static int test_early_data_psk_with_all_ciphers(int idx)
44534453
# endif
44544454
TLS1_3_RFC_AES_128_CCM_SHA256,
44554455
TLS1_3_RFC_AES_128_CCM_8_SHA256,
4456-
# if !defined(OPENSSL_NO_TLS1_3_INTEGRITY_ONLY_CIPHERS)
4456+
# if !defined(OPENSSL_NO_INTEGRITY_ONLY_CIPHERS)
44574457
TLS1_3_RFC_SHA256_SHA256,
44584458
TLS1_3_RFC_SHA384_SHA384
44594459
#else
@@ -4471,7 +4471,7 @@ static int test_early_data_psk_with_all_ciphers(int idx)
44714471
# endif
44724472
TLS13_AES_128_CCM_SHA256_BYTES,
44734473
TLS13_AES_128_CCM_8_SHA256_BYTES,
4474-
# if !defined(OPENSSL_NO_TLS1_3_INTEGRITY_ONLY_CIPHERS)
4474+
# if !defined(OPENSSL_NO_INTEGRITY_ONLY_CIPHERS)
44754475
TLS13_SHA256_SHA256_BYTES,
44764476
TLS13_SHA384_SHA384_BYTES
44774477
#else
@@ -5351,7 +5351,7 @@ static int test_tls13_ciphersuite(int idx)
53515351
/* CCM8 ciphers are considered low security due to their short tag */
53525352
{ TLS1_3_RFC_AES_128_CCM_8_SHA256
53535353
":" TLS1_3_RFC_AES_128_CCM_SHA256, 1, 1 },
5354-
# if !defined(OPENSSL_NO_TLS1_3_INTEGRITY_ONLY_CIPHERS)
5354+
# if !defined(OPENSSL_NO_INTEGRITY_ONLY_CIPHERS)
53555355
/* Integrity-only cipher do not provide any confidentiality */
53565356
{ TLS1_3_RFC_SHA256_SHA256, 0, 1 },
53575357
{ TLS1_3_RFC_SHA384_SHA384, 0, 1 }

0 commit comments

Comments
 (0)