diff options
Diffstat (limited to 'src/lib/libssl/ssl_asn1.c')
-rw-r--r-- | src/lib/libssl/ssl_asn1.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c index f4552f1c94..ef34cbdb04 100644 --- a/src/lib/libssl/ssl_asn1.c +++ b/src/lib/libssl/ssl_asn1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_asn1.c,v 1.67 2023/07/08 16:40:13 beck Exp $ */ | 1 | /* $OpenBSD: ssl_asn1.c,v 1.68 2024/07/20 04:04:23 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -70,10 +70,7 @@ SSL_SESSION_encode(SSL_SESSION *s, unsigned char **out, size_t *out_len, | |||
70 | goto err; | 70 | goto err; |
71 | 71 | ||
72 | /* Cipher suite ID. */ | 72 | /* Cipher suite ID. */ |
73 | /* XXX - require cipher to be non-NULL or always/only use cipher_id. */ | ||
74 | cid = (uint16_t)(s->cipher_id & SSL3_CK_VALUE_MASK); | 73 | cid = (uint16_t)(s->cipher_id & SSL3_CK_VALUE_MASK); |
75 | if (s->cipher != NULL) | ||
76 | cid = ssl3_cipher_get_value(s->cipher); | ||
77 | if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING)) | 74 | if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING)) |
78 | goto err; | 75 | goto err; |
79 | if (!CBB_add_u16(&cipher_suite, cid)) | 76 | if (!CBB_add_u16(&cipher_suite, cid)) |
@@ -196,7 +193,7 @@ SSL_SESSION_ticket(SSL_SESSION *ss, unsigned char **out, size_t *out_len) | |||
196 | if (ss == NULL) | 193 | if (ss == NULL) |
197 | return 0; | 194 | return 0; |
198 | 195 | ||
199 | if (ss->cipher == NULL && ss->cipher_id == 0) | 196 | if (ss->cipher_id == 0) |
200 | return 0; | 197 | return 0; |
201 | 198 | ||
202 | return SSL_SESSION_encode(ss, out, out_len, 1); | 199 | return SSL_SESSION_encode(ss, out, out_len, 1); |
@@ -212,7 +209,7 @@ i2d_SSL_SESSION(SSL_SESSION *ss, unsigned char **pp) | |||
212 | if (ss == NULL) | 209 | if (ss == NULL) |
213 | return 0; | 210 | return 0; |
214 | 211 | ||
215 | if (ss->cipher == NULL && ss->cipher_id == 0) | 212 | if (ss->cipher_id == 0) |
216 | return 0; | 213 | return 0; |
217 | 214 | ||
218 | if (!SSL_SESSION_encode(ss, &data, &data_len, 0)) | 215 | if (!SSL_SESSION_encode(ss, &data, &data_len, 0)) |
@@ -287,9 +284,6 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) | |||
287 | goto err; | 284 | goto err; |
288 | if (CBS_len(&cipher_suite) != 0) | 285 | if (CBS_len(&cipher_suite) != 0) |
289 | goto err; | 286 | goto err; |
290 | |||
291 | /* XXX - populate cipher instead? */ | ||
292 | s->cipher = NULL; | ||
293 | s->cipher_id = SSL3_CK_ID | cipher_value; | 287 | s->cipher_id = SSL3_CK_ID | cipher_value; |
294 | 288 | ||
295 | /* Session ID. */ | 289 | /* Session ID. */ |