1 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
3 # Licensed under the OpenSSL license (the "License"). You may not use
4 # this file except in compliance with the License. You can obtain a copy
5 # in the file LICENSE in the source distribution or at
6 # https://www.openssl.org/source/license.html
10 package TLSProxy::NewSessionTicket;
13 push @ISA, 'TLSProxy::Message';
22 $message_frag_lens) = @_;
24 my $self = $class->SUPER::new(
26 TLSProxy::Message::MT_NEW_SESSION_TICKET,
32 $self->{ticket_lifetime_hint} = 0;
42 my $ticket_lifetime_hint = unpack('N', $self->data);
43 my $ticket_len = unpack('n', $self->data);
44 my $ticket = substr($self->data, 6, $ticket_len);
46 $self->ticket_lifetime_hint($ticket_lifetime_hint);
47 $self->ticket($ticket);
51 #Reconstruct the on-the-wire message data following changes
52 sub set_message_contents
57 $data = pack('N', $self->ticket_lifetime_hint);
58 $data .= pack('n', length($self->ticket));
59 $data .= $self->ticket;
65 sub ticket_lifetime_hint
69 $self->{ticket_lifetime_hint} = shift;
71 return $self->{ticket_lifetime_hint};
77 $self->{ticket} = shift;
79 return $self->{ticket};