anchor.diff:  
   (defun  throw-last-error (session)
     (multiple-value-bind (message code)
  -	  (session-last-error session)
  -	(error 'ssh-generic-error
  -		   :message message
  -		   :code    code)))
  +      (session-last-error session)
  +    (error 'ssh-generic-error
  +           :message message
  +           :code    code)))
   
   (defmacro with-last-error ((session error-type) &rest args)
     `(multiple-value-bind (message code)
  -	   (session-last-error ,session)
  -	 (error (quote ,error-type)
  -			:message message
  -			:code    code
  -			,@args)))
  +       (session-last-error ,session)
  +     (error (quote ,error-type)
  +            :message message
  +            :code    code
  +            ,@args)))
   
   (defclass auth-data ()
     ((login    :type      string
  -			 :initarg   :login
  -			 :initform  ""
  -			 :reader    login)))
  +             :initarg   :login
  +             :initform  ""
  +             :reader    login)))
   
   (defclass ssh-connection ()
     ((session     :type     +session+
  -				:initarg  :session
  -				:initform (null-pointer)
  -				:reader   session)
  +                :initarg  :session
  +                :initform (null-pointer)
  +                :reader   session)
      (socket      :type     usocket:socket
  -				:initarg  :socket
  -				:accessor socket)
  +                :initarg  :socket
  +                :accessor socket)
      (host        :type     string
  -				:initarg  :host
  -				:accessor host)
  +                :initarg  :host
  +                :accessor host)
      (port        :type     int
  -				:initarg  :port
  -				:accessor port)
  +                :initarg  :port
  +                :accessor port)
      (hosts-db    :type     string
  -				:initarg  :hosts-db
  -				:accessor hosts-db)
  +                :initarg  :hosts-db
  +                :accessor hosts-db)
      (auth-passed :type     boolean
  -				:initform nil
  -				:accessor auth-passed)))
  +                :initform nil
  +                :accessor auth-passed)))
   
   (define-condition ssh-handshake-error (ssh-generic-error) ())
   
   (define-condition ssh-bad-hostkey (error)
     ((reason :type      +check-verdict+
  -		   :accessor  reason
  -		   :initarg   :reason)
  +           :accessor  reason
  +           :initarg   :reason)
      (hash   :type      string
  -		   :accessor  hash
  -		   :initarg   :hash)))
  +           :accessor  hash
  +           :initarg   :hash)))
   
   (defmethod create-ssh-connection (host (hosts-db string)
  -								  &key
  -								  (port 22)
  -								  (read-timeout 5)
  -								  (write-timeout 5))
  +                  &key
  +                  (port 22)
  +                  (read-timeout 5)
  +                  (write-timeout 5))
     (let ((new-session nil)
  -		(new-socket  nil)
  -		(retval      :error-none))
  -	(unwind-protect
  -		 (progn
  -		   (setq new-session (session-init))
  -		   (setq new-socket (usocket:socket-connect host port))
  -		   (set-timeouts new-socket read-timeout write-timeout)
  -		   (session-set-blocking new-session :blocking)
  -
  -		   (setq retval
  -				 (session-handshake new-session (usocket-get-fd new-socket)))
  -
  -		   (if (eq retval :error-none)
  -			   (make-instance 'ssh-connection
  -							  :session  new-session
  -							  :socket   new-socket
  -							  :host     host
  -							  :port     port
  -							  :hosts-db hosts-db)
  -			   (throw-last-error new-session)))
  -	  (unless (eq retval :error-none)
  -		(unless (null-pointer-p new-session)
  -		  (session-free new-session))
  -		(unless (null new-socket)
  -		  (usocket:socket-close new-socket))
  -		nil))))
  +    (new-socket  nil)
  +    (retval      :error-none))
  +  (unwind-protect
  +     (progn
  +       (setq new-session (session-init))
  +       (setq new-socket (usocket:socket-connect host port))
  +       (set-timeouts new-socket read-timeout write-timeout)
  +       (session-set-blocking new-session :blocking)
  +
  +       (setq retval
  +         (session-handshake new-session (usocket-get-fd new-socket)))
  +
  +       (if (eq retval :error-none)
  +         (make-instance 'ssh-connection
  +                :session  new-session
  +                :socket   new-socket
  +                :host     host
  +                :port     port
  +                :hosts-db hosts-db)
  +         (throw-last-error new-session)))
  +    (unless (eq retval :error-none)
  +    (unless (null-pointer-p new-session)
  +      (session-free new-session))
  +    (unless (null new-socket)
  +      (usocket:socket-close new-socket))
  +    nil))))
   
   
   (defmethod destroy-ssh-connection ((ssh ssh-connection) &key (description "") (lang ""))
  
positive.code: 
  (defmethod stream-write-byte ((stream ssh-channel-stream-output) byte)
    (with-slots (output-pos output-size output-buffer) stream
  	  (if (>= output-size (length output-buffer))
  		  (stream-finish-output* stream :dont-send-eof t))
  	  (when (< output-size (length output-buffer))
  		(prog1
  			(setf (aref output-buffer output-size) byte)
  		  (incf output-size 1)))))
  
  (defmethod stream-write-char ((stream ssh-channel-stream-output) char)
    (stream-write-byte stream (char-code char)))
  
negative.code:           t
            (restart-case
                (error 'ssh-bad-hostkey
             :reason host-key-status
             :key (session-hostkey-fingerprint (session ssh)))
        (accept () t)
        (drop () nil)
        (accept-once  (&optional (comment ""))
          (progn
          (known-hosts-add known-hosts (ssh-host+port-format ssh) host-key
                   :comment comment)
          t))
        (accept-always (&optional (comment ""))
          (progn
          (known-hosts-add known-hosts (ssh-host+port-format ssh) host-key
                   :comment comment)
          (known-hosts-writefile known-hosts (hosts-db ssh))
          t)))))))
  
  (defmethod authentication-methods ((ssh ssh-connection) (login string))
    (session-auth-methods-list (session ssh) login))
  
  (defmethod authentication :around ((ssh ssh-connection) (auth auth-data))
    (if (auth-passed ssh)
      t
      (if (ssh-verify-session ssh)
        (setf (auth-passed ssh)
          (eq
           (call-next-method) :error-none)))))
  
  (defmethod authentication ((ssh ssh-connection) (auth auth-password))
    (user-auth-password (session  ssh)
              (login    auth)
              (password auth)))
  
  (defclass auth-publickey (auth-data)
    ((public-key  :type     string
                  :initarg  :public-key
                  :initform "id_rsa.pub"
                  :accessor public-key)
     (private-key :type     string
                  :initarg  :private-key
                  :initform "id_rsa"
                  :accessor private-key)
     (password    :type     string
                  :initarg  :password
                  :initform ""
                  :accessor password)))
  
  (defmethod authentication ((ssh ssh-connection) (auth auth-publickey))
    (with-slots (login public-key private-key password) auth
    (user-auth-publickey (session ssh)
               login public-key private-key password)))
  
  (defclass auth-agent (auth-data) ())
  
  (defmethod authentication ((ssh ssh-connection) (auth auth-agent))
    (let ((agent (agent-init (session ssh)))
      (username (login auth)))
    (unwind-protect
       (if (and agent
            (eq (agent-connect agent)
              :error-none))
         (let ((next-identity (agent-identities-iterator agent)))
           (when next-identity
           (with-foreign-string (fs-username username)
             (loop for identity = (funcall next-identity)
              while identity do
              (if (eq
                 (%agent-userauth agent fs-username identity)
                 :ERROR-NONE)
                (return t))))))
         (throw-last-error (session ssh)))
      (when agent
      (agent-free agent)))))
  
  (defun make-publickey-auth (login directory private-key-name &optional (password ""))
    (let ((private-key
           (namestring (make-pathname :directory directory
                                      :name private-key-name)))
          (public-key
           (namestring (make-pathname :directory directory
                                      :name private-key-name
                                      :type "pub"))))
      (make-instance 'auth-publickey
                     :login       login
                     :public-key  public-key
                     :private-key private-key
                     :password    password)))
  
  (defun make-agent-auth (login)
    (make-instance 'auth-agent
                   :login login))
  
  (defun make-password-auth (login password)
    (make-instance 'auth-password
                   :login    login
                   :password password))
  
  (defvar *ssh-channel-buffer-size* 1400)
  
  (defclass ssh-channel-stream
      (trivial-gray-stream-mixin)
    ((socket        :initarg  :socket
                    :accessor socket)
     (channel       :type     +CHANNEL+
                    :initarg  :channel
                    :accessor channel)))
  
  (defclass ssh-channel-stream-output
      (ssh-channel-stream)
    ((output-buffer :initform (make-shareable-byte-vector
                               *ssh-channel-buffer-size*)
                    :accessor output-buffer)
     (output-size   :initform 0
                    :accessor output-size
                    :type     int)
     (output-pos    :type     int
                    :initform 0
                    :accessor output-pos)))
  
  (defclass ssh-channel-stream-input
      (ssh-channel-stream)
    ((input-buffer  :initform (make-shareable-byte-vector
                               *ssh-channel-buffer-size*)
                    :accessor input-buffer)
     (input-size    :initform 0
                    :accessor input-size
                    :type     int)
     (input-pos     :type     int
                    :initform 0
                    :accessor input-pos)))
  
  (defclass ssh-channel-stream-input/output
    (ssh-channel-stream-input
     ssh-channel-stream-output)
    ())
  
  (defclass ssh-channel-exec
    (ssh-channel-stream-input/output
     fundamental-binary-output-stream
     fundamental-character-output-stream
     fundamental-binary-input-stream
     fundamental-character-input-stream)
    ())
  
  (defclass ssh-channel-recv
    (ssh-channel-stream-input
     fundamental-binary-input-stream)
    ())
  
  (defclass ssh-channel-send
    (ssh-channel-stream-output
     fundamental-binary-output-stream)
    ())
  
  (defmethod stream-element-type ((stream ssh-channel-stream))
  