Subject: Re: [libssh2] #276: do not fail when keys of unknown type are read from known_hosts file

Re: [libssh2] #276: do not fail when keys of unknown type are read from known_hosts file

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Fri, 04 Oct 2013 09:56:16 -0000

#276: do not fail when keys of unknown type are read from known_hosts file
---------------------+-------------------
  Reporter: salva | Owner:
      Type: defect | Status: new
  Priority: normal | Milestone: 1.4.3
 Component: misc | Version: 1.4.2
Resolution: | Keywords:
Blocked By: | Blocks:
---------------------+-------------------

Comment (by alamaison):

 Yes, we needed this functionality. Thanks.

 A couple of observations about knownhost.c:

  - On line 1019 you use `strlen` to find the length of the key type name.
 But this string may come from the user and they are asked to supply it as
 a buffer and length pair. Therefore `strlen` isn't usable here as
 (theoretically) it could contain anything including NUL characters. I
 know, who would want to do that (multi-byte character set maybe?), but the
 API should do what it promises.

  - The bottom of the file uses a `goto`. There are some legitimate uses
 of `goto` but this is not one of them. If multiple places need to return
 the buffer-too-small error then multiple places should return that error.

-- 
Ticket URL: <https://trac.libssh2.org/ticket/276#comment:1>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-10-04