summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-05-10 05:08:05 +0000
committertb <>2024-05-10 05:08:05 +0000
commitfadf444697d647a8b122bdc967653df5d43b5c0f (patch)
tree448213299f69767b227de60a21af07b77bf39def /src
parente187598b3af245fef99788faf28736cce0498577 (diff)
downloadopenbsd-fadf444697d647a8b122bdc967653df5d43b5c0f.tar.gz
openbsd-fadf444697d647a8b122bdc967653df5d43b5c0f.tar.bz2
openbsd-fadf444697d647a8b122bdc967653df5d43b5c0f.zip
Remove fixed nonce length information from algorithm2
This information has been part of tls12_key_block_generate() for a while now. It remained in this table because at that point SSL_CIPHER was still public. Nothing can access algorithm2 anymore from the outside, so this is dead weight. ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/s3_lib.c58
-rw-r--r--src/lib/libssl/ssl_local.h16
2 files changed, 15 insertions, 59 deletions
diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c
index 6ebe2605da..0eec6e9712 100644
--- a/src/lib/libssl/s3_lib.c
+++ b/src/lib/libssl/s3_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s3_lib.c,v 1.251 2024/03/02 11:46:55 tb Exp $ */ 1/* $OpenBSD: s3_lib.c,v 1.252 2024/05/10 05:08:05 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -168,13 +168,6 @@
168 168
169#define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers) / sizeof(SSL_CIPHER)) 169#define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers) / sizeof(SSL_CIPHER))
170 170
171/*
172 * FIXED_NONCE_LEN is a macro that provides in the correct value to set the
173 * fixed nonce length in algorithms2. It is the inverse of the
174 * SSL_CIPHER_AEAD_FIXED_NONCE_LEN macro.
175 */
176#define FIXED_NONCE_LEN(x) (((x / 2) & 0xf) << 24)
177
178/* list of available SSLv3 ciphers (sorted by id) */ 171/* list of available SSLv3 ciphers (sorted by id) */
179const SSL_CIPHER ssl3_ciphers[] = { 172const SSL_CIPHER ssl3_ciphers[] = {
180 173
@@ -644,9 +637,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
644 .algorithm_mac = SSL_AEAD, 637 .algorithm_mac = SSL_AEAD,
645 .algorithm_ssl = SSL_TLSV1_2, 638 .algorithm_ssl = SSL_TLSV1_2,
646 .algo_strength = SSL_HIGH, 639 .algo_strength = SSL_HIGH,
647 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 640 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
648 FIXED_NONCE_LEN(4)|
649 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
650 .strength_bits = 128, 641 .strength_bits = 128,
651 .alg_bits = 128, 642 .alg_bits = 128,
652 }, 643 },
@@ -662,9 +653,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
662 .algorithm_mac = SSL_AEAD, 653 .algorithm_mac = SSL_AEAD,
663 .algorithm_ssl = SSL_TLSV1_2, 654 .algorithm_ssl = SSL_TLSV1_2,
664 .algo_strength = SSL_HIGH, 655 .algo_strength = SSL_HIGH,
665 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| 656 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
666 FIXED_NONCE_LEN(4)|
667 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
668 .strength_bits = 256, 657 .strength_bits = 256,
669 .alg_bits = 256, 658 .alg_bits = 256,
670 }, 659 },
@@ -680,9 +669,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
680 .algorithm_mac = SSL_AEAD, 669 .algorithm_mac = SSL_AEAD,
681 .algorithm_ssl = SSL_TLSV1_2, 670 .algorithm_ssl = SSL_TLSV1_2,
682 .algo_strength = SSL_HIGH, 671 .algo_strength = SSL_HIGH,
683 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 672 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
684 FIXED_NONCE_LEN(4)|
685 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
686 .strength_bits = 128, 673 .strength_bits = 128,
687 .alg_bits = 128, 674 .alg_bits = 128,
688 }, 675 },
@@ -698,9 +685,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
698 .algorithm_mac = SSL_AEAD, 685 .algorithm_mac = SSL_AEAD,
699 .algorithm_ssl = SSL_TLSV1_2, 686 .algorithm_ssl = SSL_TLSV1_2,
700 .algo_strength = SSL_HIGH, 687 .algo_strength = SSL_HIGH,
701 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| 688 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
702 FIXED_NONCE_LEN(4)|
703 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
704 .strength_bits = 256, 689 .strength_bits = 256,
705 .alg_bits = 256, 690 .alg_bits = 256,
706 }, 691 },
@@ -716,9 +701,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
716 .algorithm_mac = SSL_AEAD, 701 .algorithm_mac = SSL_AEAD,
717 .algorithm_ssl = SSL_TLSV1_2, 702 .algorithm_ssl = SSL_TLSV1_2,
718 .algo_strength = SSL_HIGH, 703 .algo_strength = SSL_HIGH,
719 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 704 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
720 FIXED_NONCE_LEN(4)|
721 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
722 .strength_bits = 128, 705 .strength_bits = 128,
723 .alg_bits = 128, 706 .alg_bits = 128,
724 }, 707 },
@@ -734,9 +717,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
734 .algorithm_mac = SSL_AEAD, 717 .algorithm_mac = SSL_AEAD,
735 .algorithm_ssl = SSL_TLSV1_2, 718 .algorithm_ssl = SSL_TLSV1_2,
736 .algo_strength = SSL_HIGH, 719 .algo_strength = SSL_HIGH,
737 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| 720 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
738 FIXED_NONCE_LEN(4)|
739 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
740 .strength_bits = 256, 721 .strength_bits = 256,
741 .alg_bits = 256, 722 .alg_bits = 256,
742 }, 723 },
@@ -1215,9 +1196,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1215 .algorithm_mac = SSL_AEAD, 1196 .algorithm_mac = SSL_AEAD,
1216 .algorithm_ssl = SSL_TLSV1_2, 1197 .algorithm_ssl = SSL_TLSV1_2,
1217 .algo_strength = SSL_HIGH, 1198 .algo_strength = SSL_HIGH,
1218 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 1199 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1219 FIXED_NONCE_LEN(4)|
1220 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
1221 .strength_bits = 128, 1200 .strength_bits = 128,
1222 .alg_bits = 128, 1201 .alg_bits = 128,
1223 }, 1202 },
@@ -1233,9 +1212,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1233 .algorithm_mac = SSL_AEAD, 1212 .algorithm_mac = SSL_AEAD,
1234 .algorithm_ssl = SSL_TLSV1_2, 1213 .algorithm_ssl = SSL_TLSV1_2,
1235 .algo_strength = SSL_HIGH, 1214 .algo_strength = SSL_HIGH,
1236 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| 1215 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1237 FIXED_NONCE_LEN(4)|
1238 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
1239 .strength_bits = 256, 1216 .strength_bits = 256,
1240 .alg_bits = 256, 1217 .alg_bits = 256,
1241 }, 1218 },
@@ -1251,9 +1228,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1251 .algorithm_mac = SSL_AEAD, 1228 .algorithm_mac = SSL_AEAD,
1252 .algorithm_ssl = SSL_TLSV1_2, 1229 .algorithm_ssl = SSL_TLSV1_2,
1253 .algo_strength = SSL_HIGH, 1230 .algo_strength = SSL_HIGH,
1254 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 1231 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1255 FIXED_NONCE_LEN(4)|
1256 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
1257 .strength_bits = 128, 1232 .strength_bits = 128,
1258 .alg_bits = 128, 1233 .alg_bits = 128,
1259 }, 1234 },
@@ -1269,9 +1244,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1269 .algorithm_mac = SSL_AEAD, 1244 .algorithm_mac = SSL_AEAD,
1270 .algorithm_ssl = SSL_TLSV1_2, 1245 .algorithm_ssl = SSL_TLSV1_2,
1271 .algo_strength = SSL_HIGH, 1246 .algo_strength = SSL_HIGH,
1272 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384| 1247 .algorithm2 = SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
1273 FIXED_NONCE_LEN(4)|
1274 SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD,
1275 .strength_bits = 256, 1248 .strength_bits = 256,
1276 .alg_bits = 256, 1249 .alg_bits = 256,
1277 }, 1250 },
@@ -1287,8 +1260,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1287 .algorithm_mac = SSL_AEAD, 1260 .algorithm_mac = SSL_AEAD,
1288 .algorithm_ssl = SSL_TLSV1_2, 1261 .algorithm_ssl = SSL_TLSV1_2,
1289 .algo_strength = SSL_HIGH, 1262 .algo_strength = SSL_HIGH,
1290 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 1263 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1291 FIXED_NONCE_LEN(12),
1292 .strength_bits = 256, 1264 .strength_bits = 256,
1293 .alg_bits = 256, 1265 .alg_bits = 256,
1294 }, 1266 },
@@ -1304,8 +1276,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1304 .algorithm_mac = SSL_AEAD, 1276 .algorithm_mac = SSL_AEAD,
1305 .algorithm_ssl = SSL_TLSV1_2, 1277 .algorithm_ssl = SSL_TLSV1_2,
1306 .algo_strength = SSL_HIGH, 1278 .algo_strength = SSL_HIGH,
1307 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 1279 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1308 FIXED_NONCE_LEN(12),
1309 .strength_bits = 256, 1280 .strength_bits = 256,
1310 .alg_bits = 256, 1281 .alg_bits = 256,
1311 }, 1282 },
@@ -1321,8 +1292,7 @@ const SSL_CIPHER ssl3_ciphers[] = {
1321 .algorithm_mac = SSL_AEAD, 1292 .algorithm_mac = SSL_AEAD,
1322 .algorithm_ssl = SSL_TLSV1_2, 1293 .algorithm_ssl = SSL_TLSV1_2,
1323 .algo_strength = SSL_HIGH, 1294 .algo_strength = SSL_HIGH,
1324 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256| 1295 .algorithm2 = SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
1325 FIXED_NONCE_LEN(12),
1326 .strength_bits = 256, 1296 .strength_bits = 256,
1327 .alg_bits = 256, 1297 .alg_bits = 256,
1328 }, 1298 },
diff --git a/src/lib/libssl/ssl_local.h b/src/lib/libssl/ssl_local.h
index 2266d5e3ce..551bdd5766 100644
--- a/src/lib/libssl/ssl_local.h
+++ b/src/lib/libssl/ssl_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_local.h,v 1.14 2024/03/26 03:44:11 beck Exp $ */ 1/* $OpenBSD: ssl_local.h,v 1.15 2024/05/10 05:08:05 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -263,20 +263,6 @@ __BEGIN_HIDDEN_DECLS
263#define TLS1_PRF (TLS1_PRF_MD5 | TLS1_PRF_SHA1) 263#define TLS1_PRF (TLS1_PRF_MD5 | TLS1_PRF_SHA1)
264 264
265/* 265/*
266 * SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD is an algorithm2 flag that
267 * indicates that the variable part of the nonce is included as a prefix of
268 * the record (AES-GCM, for example, does this with an 8-byte variable nonce.)
269 */
270#define SSL_CIPHER_ALGORITHM2_VARIABLE_NONCE_IN_RECORD (1 << 22)
271
272/*
273 * SSL_CIPHER_AEAD_FIXED_NONCE_LEN returns the number of bytes of fixed nonce
274 * for an SSL_CIPHER with an algorithm_mac of SSL_AEAD.
275 */
276#define SSL_CIPHER_AEAD_FIXED_NONCE_LEN(ssl_cipher) \
277 (((ssl_cipher->algorithm2 >> 24) & 0xf) * 2)
278
279/*
280 * Cipher strength information. 266 * Cipher strength information.
281 */ 267 */
282#define SSL_STRONG_MASK 0x000001fcL 268#define SSL_STRONG_MASK 0x000001fcL