Lines Matching refs:as

112     SSL_SESSION_ASN1 as;  in i2d_SSL_SESSION()  local
139 memset(&as, 0, sizeof(as)); in i2d_SSL_SESSION()
141 as.version = SSL_SESSION_ASN1_VERSION; in i2d_SSL_SESSION()
142 as.ssl_version = in->ssl_version; in i2d_SSL_SESSION()
144 as.kex_group = in->kex_group; in i2d_SSL_SESSION()
153 ssl_session_oinit(&as.cipher, &cipher, cipher_data, 2); in i2d_SSL_SESSION()
158 ssl_session_oinit(&as.comp_id, &comp_id, &comp_id_data, 1); in i2d_SSL_SESSION()
162 ssl_session_oinit(&as.master_key, &master_key, in i2d_SSL_SESSION()
165 ssl_session_oinit(&as.session_id, &session_id, in i2d_SSL_SESSION()
168 ssl_session_oinit(&as.session_id_context, &sid_ctx, in i2d_SSL_SESSION()
171 as.time = (int64_t)ossl_time_to_time_t(in->time); in i2d_SSL_SESSION()
172 as.timeout = (int64_t)ossl_time2seconds(in->timeout); in i2d_SSL_SESSION()
173 as.verify_result = in->verify_result; in i2d_SSL_SESSION()
175 as.peer = in->peer; in i2d_SSL_SESSION()
177 as.peer_rpk = NULL; in i2d_SSL_SESSION()
182 as.peer_rpk = &peer_rpk; in i2d_SSL_SESSION()
185 ssl_session_sinit(&as.tlsext_hostname, &tlsext_hostname, in i2d_SSL_SESSION()
188 ssl_session_oinit(&as.tlsext_tick, &tlsext_tick, in i2d_SSL_SESSION()
192 as.tlsext_tick_lifetime_hint = in->ext.tick_lifetime_hint; in i2d_SSL_SESSION()
193 as.tlsext_tick_age_add = in->ext.tick_age_add; in i2d_SSL_SESSION()
195 ssl_session_sinit(&as.psk_identity_hint, &psk_identity_hint, in i2d_SSL_SESSION()
197 ssl_session_sinit(&as.psk_identity, &psk_identity, in->psk_identity); in i2d_SSL_SESSION()
200 ssl_session_sinit(&as.srp_username, &srp_username, in->srp_username); in i2d_SSL_SESSION()
203 as.flags = in->flags; in i2d_SSL_SESSION()
204 as.max_early_data = in->ext.max_early_data; in i2d_SSL_SESSION()
207 as.alpn_selected = NULL; in i2d_SSL_SESSION()
209 ssl_session_oinit(&as.alpn_selected, &alpn_selected, in i2d_SSL_SESSION()
212 as.tlsext_max_fragment_len_mode = in->ext.max_fragment_len_mode; in i2d_SSL_SESSION()
215 as.ticket_appdata = NULL; in i2d_SSL_SESSION()
217 ssl_session_oinit(&as.ticket_appdata, &ticket_appdata, in i2d_SSL_SESSION()
220 ret = i2d_SSL_SESSION_ASN1(&as, pp); in i2d_SSL_SESSION()
269 SSL_SESSION_ASN1 *as = NULL; in d2i_SSL_SESSION_ex() local
272 as = d2i_SSL_SESSION_ASN1(NULL, &p, length); in d2i_SSL_SESSION_ex()
274 if (as == NULL) in d2i_SSL_SESSION_ex()
285 if (as->version != SSL_SESSION_ASN1_VERSION) { in d2i_SSL_SESSION_ex()
290 if ((as->ssl_version >> 8) != SSL3_VERSION_MAJOR in d2i_SSL_SESSION_ex()
291 && (as->ssl_version >> 8) != DTLS1_VERSION_MAJOR in d2i_SSL_SESSION_ex()
292 && as->ssl_version != DTLS1_BAD_VER) { in d2i_SSL_SESSION_ex()
297 ret->ssl_version = (int)as->ssl_version; in d2i_SSL_SESSION_ex()
299 ret->kex_group = as->kex_group; in d2i_SSL_SESSION_ex()
301 if (as->cipher->length != 2) { in d2i_SSL_SESSION_ex()
306 id = 0x03000000L | ((unsigned long)as->cipher->data[0] << 8L) in d2i_SSL_SESSION_ex()
307 | (unsigned long)as->cipher->data[1]; in d2i_SSL_SESSION_ex()
315 as->session_id, SSL3_MAX_SSL_SESSION_ID_LENGTH)) in d2i_SSL_SESSION_ex()
319 as->master_key, TLS13_MAX_RESUMPTION_PSK_LENGTH)) in d2i_SSL_SESSION_ex()
324 if (as->time != 0) in d2i_SSL_SESSION_ex()
325 ret->time = ossl_time_from_time_t(as->time); in d2i_SSL_SESSION_ex()
329 if (as->timeout != 0) in d2i_SSL_SESSION_ex()
330 ret->timeout = ossl_seconds2time(as->timeout); in d2i_SSL_SESSION_ex()
336 ret->peer = as->peer; in d2i_SSL_SESSION_ex()
337 as->peer = NULL; in d2i_SSL_SESSION_ex()
341 if (as->peer_rpk != NULL) { in d2i_SSL_SESSION_ex()
342 const unsigned char *data = as->peer_rpk->data; in d2i_SSL_SESSION_ex()
347 ret->peer_rpk = d2i_PUBKEY_ex(NULL, &data, as->peer_rpk->length, libctx, propq); in d2i_SSL_SESSION_ex()
353 as->session_id_context, SSL_MAX_SID_CTX_LENGTH)) in d2i_SSL_SESSION_ex()
357 ret->verify_result = as->verify_result; in d2i_SSL_SESSION_ex()
359 if (!ssl_session_strndup(&ret->ext.hostname, as->tlsext_hostname)) in d2i_SSL_SESSION_ex()
363 if (!ssl_session_strndup(&ret->psk_identity_hint, as->psk_identity_hint)) in d2i_SSL_SESSION_ex()
365 if (!ssl_session_strndup(&ret->psk_identity, as->psk_identity)) in d2i_SSL_SESSION_ex()
369 ret->ext.tick_lifetime_hint = (unsigned long)as->tlsext_tick_lifetime_hint; in d2i_SSL_SESSION_ex()
370 ret->ext.tick_age_add = as->tlsext_tick_age_add; in d2i_SSL_SESSION_ex()
372 if (as->tlsext_tick != NULL) { in d2i_SSL_SESSION_ex()
373 ret->ext.tick = as->tlsext_tick->data; in d2i_SSL_SESSION_ex()
374 ret->ext.ticklen = as->tlsext_tick->length; in d2i_SSL_SESSION_ex()
375 as->tlsext_tick->data = NULL; in d2i_SSL_SESSION_ex()
380 if (as->comp_id) { in d2i_SSL_SESSION_ex()
381 if (as->comp_id->length != 1) { in d2i_SSL_SESSION_ex()
385 ret->compress_meth = as->comp_id->data[0]; in d2i_SSL_SESSION_ex()
392 if (!ssl_session_strndup(&ret->srp_username, as->srp_username)) in d2i_SSL_SESSION_ex()
396 ret->flags = (int32_t)as->flags; in d2i_SSL_SESSION_ex()
397 ret->ext.max_early_data = as->max_early_data; in d2i_SSL_SESSION_ex()
400 if (as->alpn_selected != NULL) { in d2i_SSL_SESSION_ex()
401 ret->ext.alpn_selected = as->alpn_selected->data; in d2i_SSL_SESSION_ex()
402 ret->ext.alpn_selected_len = as->alpn_selected->length; in d2i_SSL_SESSION_ex()
403 as->alpn_selected->data = NULL; in d2i_SSL_SESSION_ex()
409 ret->ext.max_fragment_len_mode = as->tlsext_max_fragment_len_mode; in d2i_SSL_SESSION_ex()
412 if (as->ticket_appdata != NULL) { in d2i_SSL_SESSION_ex()
413 ret->ticket_appdata = as->ticket_appdata->data; in d2i_SSL_SESSION_ex()
414 ret->ticket_appdata_len = as->ticket_appdata->length; in d2i_SSL_SESSION_ex()
415 as->ticket_appdata->data = NULL; in d2i_SSL_SESSION_ex()
421 M_ASN1_free_of(as, SSL_SESSION_ASN1); in d2i_SSL_SESSION_ex()
429 M_ASN1_free_of(as, SSL_SESSION_ASN1); in d2i_SSL_SESSION_ex()