anchor.diff:      end;
   
   cipher(#finished{} = Finished, 
  -       State = #state{negotiated_version = Version,
  -		      host = Host,
  -		      port = Port,
  -		      role = Role,
  -		      session = #session{master_secret = MasterSecret} 
  -		      = Session0,
  -                      tls_handshake_hashes = Hashes}) ->    
  -
  +       #state{negotiated_version = Version,
  +	      host = Host,
  +	      port = Port,
  +	      role = Role,
  +	      session = #session{master_secret = MasterSecret} 
  +	      = Session0,
  +	      tls_handshake_hashes = Hashes} = State0) ->    
  +    
       case ssl_handshake:verify_connection(Version, Finished, 
   					 opposite_role(Role), 
                                            MasterSecret, Hashes) of
           verified ->
  -	    ack_connection(State),
  +	    State = ack_connection(State0),
   	    Session = register_session(Role, Host, Port, Session0),
               case Role of
                   client ->
  
positive.code: 			    ok
  		    end,
  		    renegotiate(State#state{connection_states = ConnectionStates,
  					    send_queue = queue:in_r({From, RestData}, Queue)})
  	    end;
  	{empty, Queue0} ->
  	    next_state_is_connection(State)
  
negative.code:                     {NewConnectionStates, NewHashes} = 
                          finalize_server_handshake(State#state{
  						    session = Session}),
                      next_state_connection(State#state{connection_states = 
  						      NewConnectionStates,
  						      session = Session,
  						      tls_handshake_hashes =
  						      NewHashes})
              end;
          #alert{} = Alert ->
  	    handle_own_alert(Alert, Version, cipher, State0),
              {stop, normal, State0} 
      end.
  
  connection(socket_control, #state{role = server} = State) ->
  