         :args (s/cat :state ::state
                      :initiate-packet ::K/initiate-packet-spec)
         :ret (s/keys :req [::log2/state]
-                     :opt [::handled?]))
+                     :opt [::handled?
+                           ::state/client-state]))
 (defn possibly-re-initiate-existing-client-connection!
   "Client can send as many Initiate packets as it likes.
 

                                                                                             initiate)]
              (reset! log-state-atom log-state)
              (if-not handled
                (let [{cookie ::templates/cookie-spec
                       log-state ::log2/state
                       :as cookie-extraction} (extract-cookie log-state
                                                              (::state/cookie-cutter state)

                                                              initiate)]
                  (reset! log-state-atom log-state)
                  (if cookie
                    (let [log-state (log2/info log-state
                                               ::handle!
                                               "Succssfully extracted cookie")
                          {active-client ::state/client-state
                           server-short-sk ::shared/secret-key
                           {log-state ::log2/state
                            :as state} ::state/state} (configure-new-active-client (assoc state ::log2/state log-state)
                                                                                   client-short-pk
                                                                                   cookie)]
                      (reset! log-state-atom log-state)
                      ;; It included a secret cookie that we generated sometime within the
                      ;; past couple of minutes.
                      ;; Now we're ready to tackle handling the main message body cryptobox.
                      ;; This corresponds to line 373 in the reference implementation.
                      (try
                        (println "Mark: trying to open the client's crypto box")
                        (let [{log-state ::log2/state
                               client-message-box ::K/initiate-client-vouch-wrapper} (open-client-crypto-box log-state
                                                                                                             initiate
                                                                                                             active-client)]
                          (println "Mark: real result from opening crypto box:"
                                   client-message-box)
                          (reset! log-state-atom log-state)
                          (if client-message-box
                            (let [client-long-pk (bytes (::K/long-term-public-key client-message-box))
                                  log-state (log2/info log-state
                                                       "Extracted message box from client's Initiate packet"
                                                       ;; This matches both the original log
                                                       ;; message and what we see below when we
                                                       ;; try to extract the inner hidden key
                                                       {::message-box-keys (keys client-message-box)
                                                        ::client-public-long-key (b-t/->string client-long-pk)})]
                              (reset! log-state-atom log-state)
                              (try
                                (println "Mark: validating server name")
                                (if (validate-server-name state client-message-box)
                                  ;; This takes us down to line 381
                                  (if (verify-client-public-key-triad state client-short-pk client-message-box)
                                    ;; TODO: Limit the state parameter and return value to what's actually needed
                                    (do-fork-child state
                                                   active-client
                                                   client-long-pk
                                                   client-short-pk
                                                   server-short-sk
                                                   host
                                                   port
                                                   initiate
                                                   client-message-box)
                                    {::log2/state (log2/warn log-state
                                                             ::do-handle
                                                             "Mismatched public keys"
                                                             {::FIXME "Show the extracted versions"
                                                              ::state/state state
                                                              ::client-short-pk client-short-pk
                                                              ::shared/message client-message-box})}))
                                (catch ExceptionInfo ex
                                  {::log2/state (log2/exception @log-state-atom
                                                                ex
                                                                ::do-handle
                                                                "Failure after decrypting inner client cryptobox")})))
                            (assoc state ::log2/state log-state)))
                        (catch Exception ex
                          {::log2/state (log2/exception @log-state-atom
                                                        ex
                                                        ::do-handle
                                                        "Initiate packet looked good enough to establish client session, but failed later")})))
                    ;; Just log a quick message about the failure for now.
                    ;; It seems likely that we should really gather more info, especially in terms
                    ;; of identifying the source of garbage.
                    {::log2/state (log2/error log-state
                                              ::do-handle
                                              "FIXME: Debug only: cookie extraction failed")}))
                (throw (RuntimeException. "TODO: Handle additional Initiate packets from " client-short-pk)))))
          {::log2/state (log2/warn log-state
                                   ::do-handle
                                   (str "Truncated initiate packet. Only received " n " bytes"))}))

               :initiate ::serial/decomposed
               :client-message-box ::K/initiate-client-vouch-wrapper)
  :ret ::state/state)
(defn do-fork-child!
  [{log-state ::log2/state
    :as state}
   active-client
