Lines Matching full:self

83     my $self = {
113 my $proxaddr = $self->{proxy_addr};
123 $self->{proxy_sock} = $sock;
124 $self->{proxy_port} = $sock->sockport();
125 $self->{proxy_addr} = $sock->sockhost();
126 $self->{proxy_addr} =~ s/(.*:.*)/[$1]/;
128 "$self->{proxy_addr}:$self->{proxy_port}\n";
130 $self->{server_addr} = $self->{proxy_addr};
135 return bless $self, $class;
140 my $self = shift;
142 $self->{proxy_sock}->close() if $self->{proxy_sock};
147 my $self = shift;
149 $self->{cipherc} = "";
150 $self->{ciphersuitec} = "";
151 $self->{flight} = -1;
152 $self->{direction} = -1;
153 $self->{partial} = ["", ""];
154 $self->{record_list} = [];
155 $self->{message_list} = [];
156 $self->{clientflags} = "";
157 $self->{sessionfile} = undef;
158 $self->{clientpid} = 0;
168 my $self = shift;
170 $self->clearClient;
171 $self->{ciphers} = "AES128-SHA";
172 $self->{ciphersuitess} = "TLS_AES_128_GCM_SHA256";
173 $self->{serverflags} = "";
174 $self->{serverconnects} = 1;
175 $self->{serverpid} = 0;
176 $self->{reneg} = 0;
181 my $self = shift;
183 $self->clear;
184 $self->start;
189 my $self = shift;
191 $self->clear;
192 $self->clientstart;
197 my $self = shift;
198 my $servaddr = $self->{server_addr};
203 PeerPort => $self->{server_port},
207 kill(3, $self->{real_serverpid});
211 $self->{server_sock} = $sock;
216 my ($self) = shift;
219 if ($self->{proxy_sock} == 0) {
223 my $execcmd = $self->execute
231 ." -accept $self->{server_addr}:0"
232 ." -cert ".$self->cert." -cert2 ".$self->cert
233 ." -naccept ".$self->serverconnects;
234 if ($self->ciphers ne "") {
235 $execcmd .= " -cipher ".$self->ciphers;
237 if ($self->ciphersuitess ne "") {
238 $execcmd .= " -ciphersuites ".$self->ciphersuitess;
240 if ($self->serverflags ne "") {
241 $execcmd .= " ".$self->serverflags;
243 if ($self->debug) {
251 $self->{real_serverpid} = $pid;
259 $self->{server_port} = $1;
263 if ($self->{server_port} == 0) {
279 $self->{proc_handle} = $h; # hold handle till next round [or exit]
296 kill(3, $self->{real_serverpid});
300 $self->{serverpid} = $pid;
303 "$self->{server_addr}:$self->{server_port}\n";
306 $self->connect_to_server();
308 return $self->clientstart;
313 my ($self) = shift;
315 if ($self->execute) {
317 my $execcmd = $self->execute
319 ." -connect $self->{proxy_addr}:$self->{proxy_port}";
320 if ($self->cipherc ne "") {
321 $execcmd .= " -cipher ".$self->cipherc;
323 if ($self->ciphersuitesc ne "") {
324 $execcmd .= " -ciphersuites ".$self->ciphersuitesc;
326 if ($self->clientflags ne "") {
327 $execcmd .= " ".$self->clientflags;
329 if ($self->clientflags !~ m/-(no)?servername/) {
332 if (defined $self->sessionfile) {
335 if ($self->debug) {
345 kill(3, $self->{real_serverpid});
348 $self->{clientpid} = $pid;
351 print $self->reneg ? "R" : "test";
359 my $fdset = IO::Select->new($self->{proxy_sock});
361 kill(3, $self->{real_serverpid});
366 if(!($client_sock = $self->{proxy_sock}->accept())) {
373 my $server_sock = $self->{server_sock};
381 $self->{saw_session_ticket} = undef;
383 if (defined($self->{sessionfile})) {
387 && $self->{saw_session_ticket};
396 if ($indata = $self->process_packet(1, $indata)) {
406 if ($indata = $self->process_packet(0, $indata)) {
415 kill(3, $self->{real_serverpid});
422 kill(3, $self->{real_serverpid});
430 $self->{server_sock} = undef;
438 if (--$self->{serverconnects} == 0) {
439 $pid = $self->{serverpid};
445 kill(3, $self->{real_serverpid});
446 die "lost control over $self->{serverpid}?";
448 $pid = $self->{real_serverpid};
458 $self->connect_to_server();
460 $pid = $self->{clientpid};
469 my ($self, $server, $packet) = @_;
481 if ($self->{direction} != $server) {
482 $self->{flight} = $self->{flight} + 1;
483 $self->{direction} = $server;
487 print "Processing flight ".$self->flight."\n";
491 my @ret = TLSProxy::Record->get_records($server, $self->flight,
492 $self->{partial}[$server].$packet);
493 $self->{partial}[$server] = $ret[2];
494 push @{$self->{record_list}}, @{$ret[0]};
495 push @{$self->{message_list}}, @{$ret[1]};
504 if (defined $self->filter) {
505 $self->filter->($self);
509 foreach my $message (reverse @{$self->{message_list}}) {
511 $self->{saw_session_ticket} = 1;
518 foreach my $record (@{$self->record_list}) {
530 my $self = shift;
531 return $self->{execute};
535 my $self = shift;
536 return $self->{cert};
540 my $self = shift;
541 return $self->{debug};
545 my $self = shift;
546 return $self->{flight};
550 my $self = shift;
551 return $self->{record_list};
555 my $self = shift;
556 return $self->{success};
560 my $self = shift;
561 return $self->{end};
565 my $self = shift;
570 my $self = shift;
571 return $self->{proxy_addr};
575 my $self = shift;
576 return $self->{proxy_port};
580 my $self = shift;
581 return $self->{server_addr};
585 my $self = shift;
586 return $self->{server_port};
590 my $self = shift;
591 return $self->{serverpid};
595 my $self = shift;
596 return $self->{clientpid};
602 my $self = shift;
604 $self->{filter} = shift;
606 return $self->{filter};
610 my $self = shift;
612 $self->{cipherc} = shift;
614 return $self->{cipherc};
618 my $self = shift;
620 $self->{ciphersuitesc} = shift;
622 return $self->{ciphersuitesc};
626 my $self = shift;
628 $self->{ciphers} = shift;
630 return $self->{ciphers};
634 my $self = shift;
636 $self->{ciphersuitess} = shift;
638 return $self->{ciphersuitess};
642 my $self = shift;
644 $self->{serverflags} = shift;
646 return $self->{serverflags};
650 my $self = shift;
652 $self->{clientflags} = shift;
654 return $self->{clientflags};
658 my $self = shift;
660 $self->{serverconnects} = shift;
662 return $self->{serverconnects};
670 my $self = shift;
672 $self->{message_list} = shift;
674 return $self->{message_list};
698 my $self = shift;
700 $self->{reneg} = shift;
702 return $self->{reneg};
713 my $self = shift;
715 $self->{sessionfile} = shift;
718 return $self->{sessionfile};