anchor.diff:      lager:debug("Receiving message with address ~w", [Address]),
   
       lager:debug("Received message~n\tA ~p~n\tH ~s~n\tB ~s", [Address, Header, Body]),
  -    State1 = case catch ?TIME_IT(pushy_util, do_authenticate_message, (Header, Body)) of
  -                 ok ->
  -                     process_message(State, Address, Header, Body);
  -                 {no_authn, bad_sig} ->
  +
  +    KeyFetch = fun(M, EJson) -> get_key_for_method(M, State, EJson) end,
  +
  +    State1 = try ?TIME_IT(pushy_messaging, parse_message, (Header, Body, KeyFetch)) of
  +                 {ok, #pushy_message{} = Msg} ->
  +                     process_message(State, Msg);
  +                 {error, #pushy_message{validated=bad_sig}} ->
                        lager:error("Command message failed verification: header=~s", [Header]),
                        State
  +             catch
  +                 error:Error ->
  +                     Stack = erlang:get_stacktrace(),
  +                     ?debugVal(Error), ?debugVal(Stack),
  +                     lager:error("Command message parser failed horribly: header=~w~nstack~s", [Error, Stack]),
  +                     State;
                end,
       State1.
   
  
positive.code:     lager:error("Status message for job ~p and node ~p had unknown type ~p!~n", [JobId, NodeRef, UnknownType]).
  
  
  
  get_node_ref(State, Address, Data) ->
      % This essentially debug code.
      _ClientName = ej:get({<<"client">>}, Data),
      OrgName  = ej:get({<<"org">>}, Data),
      NodeName = ej:get({<<"node">>}, Data),
      OrgId = pushy_object:fetch_org_id(OrgName),
      NodeRef = {OrgId, NodeName},
      %% Every time we get a message from a node, we update it's Addr->Name mapping entry
      State2 = addr_node_map_update(State, Address, NodeRef),
      {State2, NodeRef}.
  
negative.code:     pushy_messaging:send_message(CommandSocket, [Address | Packets]),
      State.
  
  get_key_for_method(rsa2048_sha1, #state{private_key = PrivateKey}, _EJson) ->
      {ok, PrivateKey};
  get_key_for_method(hmac_sha256, _State, EJson) ->
      NodeRef = get_node_ref(EJson),
      {hmac_sha256, Key} = pushy_key_manager:get_key(NodeRef),
      {ok, Key}.
  
  
  
  %%
  