diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2022-06-06 16:12:32 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2022-06-06 16:12:32 +0000 |
commit | d5144a521c641a5ed2471ab103e0297c662c332f (patch) | |
tree | edc9ac8682cbbb293f8d4ec6bfda27985b06ead9 | |
parent | 258bdd7c0db3de9ef58ceff1aec5d599e8319819 (diff) |
Use SSL3_CK_VALUE_MASK instead of hardcoded 0xffff and remove some
SSLv2 remnants.
ok jsing
-rw-r--r-- | lib/libssl/ssl_asn1.c | 4 | ||||
-rw-r--r-- | lib/libssl/ssl_txt.c | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/lib/libssl/ssl_asn1.c b/lib/libssl/ssl_asn1.c index 70a50acc5c7..e0bf92d0357 100644 --- a/lib/libssl/ssl_asn1.c +++ b/lib/libssl/ssl_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_asn1.c,v 1.61 2022/01/11 18:39:28 jsing Exp $ */ +/* $OpenBSD: ssl_asn1.c,v 1.62 2022/06/06 16:12:30 tb Exp $ */ /* * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> * @@ -71,7 +71,7 @@ SSL_SESSION_encode(SSL_SESSION *s, unsigned char **out, size_t *out_len, /* Cipher suite ID. */ /* XXX - require cipher to be non-NULL or always/only use cipher_id. */ - cid = (uint16_t)(s->cipher_id & 0xffff); + cid = (uint16_t)(s->cipher_id & SSL3_CK_VALUE_MASK); if (s->cipher != NULL) cid = ssl3_cipher_get_value(s->cipher); if (!CBB_add_asn1(&session, &cipher_suite, CBS_ASN1_OCTETSTRING)) diff --git a/lib/libssl/ssl_txt.c b/lib/libssl/ssl_txt.c index 09685436198..b7da7bb6b4f 100644 --- a/lib/libssl/ssl_txt.c +++ b/lib/libssl/ssl_txt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_txt.c,v 1.32 2022/06/06 15:20:54 tb Exp $ */ +/* $OpenBSD: ssl_txt.c,v 1.33 2022/06/06 16:12:31 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -121,15 +121,9 @@ SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) goto err; if (x->cipher == NULL) { - if ((x->cipher_id & 0xff000000) == 0x02000000) { - if (BIO_printf(bp, " Cipher : %06lX\n", - x->cipher_id & 0xffffff) <= 0) - goto err; - } else { - if (BIO_printf(bp, " Cipher : %04lX\n", - x->cipher_id & 0xffff) <= 0) - goto err; - } + if (BIO_printf(bp, " Cipher : %04lX\n", + x->cipher_id & SSL3_CK_VALUE_MASK) <= 0) + goto err; } else { const char *cipher_name = "unknown"; |