diff options
author | tb <> | 2022-06-06 16:12:31 +0000 |
---|---|---|
committer | tb <> | 2022-06-06 16:12:31 +0000 |
commit | 0338dfd70caeed3b09fb2a9b023fad29068336ac (patch) | |
tree | b91fc02a2b07350768adf8d97a4356881758386a | |
parent | 5352ed61e080069f259dec46d7e371239b23c514 (diff) | |
download | openbsd-0338dfd70caeed3b09fb2a9b023fad29068336ac.tar.gz openbsd-0338dfd70caeed3b09fb2a9b023fad29068336ac.tar.bz2 openbsd-0338dfd70caeed3b09fb2a9b023fad29068336ac.zip |
Use SSL3_CK_VALUE_MASK instead of hardcoded 0xffff and remove some
SSLv2 remnants.
ok jsing
-rw-r--r-- | src/lib/libssl/ssl_asn1.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/ssl_txt.c | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/libssl/ssl_asn1.c b/src/lib/libssl/ssl_asn1.c index 70a50acc5c..e0bf92d035 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.61 2022/01/11 18:39:28 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_asn1.c,v 1.62 2022/06/06 16:12:30 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -71,7 +71,7 @@ SSL_SESSION_encode(SSL_SESSION *s, unsigned char **out, size_t *out_len, | |||
71 | 71 | ||
72 | /* Cipher suite ID. */ | 72 | /* Cipher suite ID. */ |
73 | /* XXX - require cipher to be non-NULL or always/only use cipher_id. */ | 73 | /* XXX - require cipher to be non-NULL or always/only use cipher_id. */ |
74 | cid = (uint16_t)(s->cipher_id & 0xffff); | 74 | cid = (uint16_t)(s->cipher_id & SSL3_CK_VALUE_MASK); |
75 | if (s->cipher != NULL) | 75 | if (s->cipher != NULL) |
76 | cid = ssl3_cipher_get_value(s->cipher); | 76 | cid = ssl3_cipher_get_value(s->cipher); |
77 | if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING)) | 77 | if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING)) |
diff --git a/src/lib/libssl/ssl_txt.c b/src/lib/libssl/ssl_txt.c index 0968543619..b7da7bb6b4 100644 --- a/src/lib/libssl/ssl_txt.c +++ b/src/lib/libssl/ssl_txt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_txt.c,v 1.32 2022/06/06 15:20:54 tb Exp $ */ | 1 | /* $OpenBSD: ssl_txt.c,v 1.33 2022/06/06 16:12:31 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 | * |
@@ -121,15 +121,9 @@ SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) | |||
121 | goto err; | 121 | goto err; |
122 | 122 | ||
123 | if (x->cipher == NULL) { | 123 | if (x->cipher == NULL) { |
124 | if ((x->cipher_id & 0xff000000) == 0x02000000) { | 124 | if (BIO_printf(bp, " Cipher : %04lX\n", |
125 | if (BIO_printf(bp, " Cipher : %06lX\n", | 125 | x->cipher_id & SSL3_CK_VALUE_MASK) <= 0) |
126 | x->cipher_id & 0xffffff) <= 0) | 126 | goto err; |
127 | goto err; | ||
128 | } else { | ||
129 | if (BIO_printf(bp, " Cipher : %04lX\n", | ||
130 | x->cipher_id & 0xffff) <= 0) | ||
131 | goto err; | ||
132 | } | ||
133 | } else { | 127 | } else { |
134 | const char *cipher_name = "unknown"; | 128 | const char *cipher_name = "unknown"; |
135 | 129 | ||