From 85792bdd4a272aa1830333e85536ca3ce269526b Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 7 Jun 2022 17:20:26 +0000 Subject: [PATCH] Simplify CBS_write_bytes() invocation Now that master_key_length is a size_t, we no longer have to fiddle with data_len. We can rather pass a pointer to it to CBS_write_bytes(). ok jsing --- lib/libssl/ssl_asn1.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/libssl/ssl_asn1.c b/lib/libssl/ssl_asn1.c index e0bf92d0357..86e0663584e 100644 --- a/lib/libssl/ssl_asn1.c +++ b/lib/libssl/ssl_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_asn1.c,v 1.62 2022/06/06 16:12:30 tb Exp $ */ +/* $OpenBSD: ssl_asn1.c,v 1.63 2022/06/07 17:20:26 tb Exp $ */ /* * Copyright (c) 2016 Joel Sing * @@ -305,11 +305,8 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) if (!CBS_get_asn1(&session, &master_key, CBS_ASN1_OCTETSTRING)) goto err; if (!CBS_write_bytes(&master_key, s->master_key, sizeof(s->master_key), - &data_len)) - goto err; - if (data_len > INT_MAX) + &s->master_key_length)) goto err; - s->master_key_length = (int)data_len; /* Time [1]. */ s->time = time(NULL); -- 2.20.1