-/* $OpenBSD: ssl_asn1.c,v 1.63 2022/06/07 17:20:26 tb Exp $ */
+/* $OpenBSD: ssl_asn1.c,v 1.64 2022/06/07 17:45:13 tb Exp $ */
/*
* Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
*
if (!CBS_get_asn1(&session, &session_id, CBS_ASN1_OCTETSTRING))
goto err;
if (!CBS_write_bytes(&session_id, s->session_id, sizeof(s->session_id),
- &data_len))
+ &s->session_id_length))
goto err;
- if (data_len > UINT_MAX)
- goto err;
- s->session_id_length = (unsigned int)data_len;
/* Master key. */
if (!CBS_get_asn1(&session, &master_key, CBS_ASN1_OCTETSTRING))
-/* $OpenBSD: ssl_clnt.c,v 1.145 2022/06/07 17:39:16 tb Exp $ */
+/* $OpenBSD: ssl_clnt.c,v 1.146 2022/06/07 17:45:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
const SSL_CIPHER *cipher;
const SSL_METHOD *method;
unsigned long alg_k;
- size_t outlen;
int al, ret;
s->internal->first_packet = 1;
* zero length session identifier.
*/
if (!CBS_write_bytes(&session_id, s->session->session_id,
- sizeof(s->session->session_id), &outlen))
+ sizeof(s->session->session_id),
+ &s->session->session_id_length))
goto err;
- s->session->session_id_length = outlen;
s->session->ssl_version = s->version;
}
-/* $OpenBSD: ssl_sess.c,v 1.114 2022/06/07 17:32:53 tb Exp $ */
+/* $OpenBSD: ssl_sess.c,v 1.115 2022/06/07 17:45:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ssl_get_prev_session(SSL *s, CBS *session_id, CBS *ext_block, int *alert)
{
SSL_SESSION *sess = NULL;
- size_t session_id_len;
int alert_desc = SSL_AD_INTERNAL_ERROR, fatal = 0;
int ticket_decrypted = 0;
* ticket has been accepted so we copy it into sess.
*/
if (!CBS_write_bytes(session_id, sess->session_id,
- sizeof(sess->session_id), &session_id_len)) {
+ sizeof(sess->session_id), &sess->session_id_length)) {
fatal = 1;
goto err;
}
- sess->session_id_length = (unsigned int)session_id_len;
break;
default:
SSLerror(s, ERR_R_INTERNAL_ERROR);