diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-07-14 17:28:34 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-07-14 17:28:34 +1000 |
commit | 29588616c214e411e1823b2949e5fa9d6a49d75f (patch) | |
tree | 345c9c73283dc0d0b92e75383b1cecea37a602ba | |
parent | 0abf13bb504ae7361d0f5ed581398c7408b073f0 (diff) |
- avsm@cvs.openbsd.org 2003/07/09 13:58:19
[key.c]
minor tweak: when generating the hex fingerprint, give strlcat the full
bound to the buffer, and add a comment below explaining why the
zero-termination is one less than the bound. markus@ ok
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | key.c | 6 |
2 files changed, 11 insertions, 3 deletions
@@ -7,6 +7,12 @@ | |||
7 | Call setauthdb() before loginfailed(), which may load password registry- | 7 | Call setauthdb() before loginfailed(), which may load password registry- |
8 | specific functions. Based on patch by cawlfiel@us.ibm.com. | 8 | specific functions. Based on patch by cawlfiel@us.ibm.com. |
9 | - (dtucker) [port-aix.h] Fix prototypes. | 9 | - (dtucker) [port-aix.h] Fix prototypes. |
10 | - (dtucker) OpenBSD CVS Sync | ||
11 | - avsm@cvs.openbsd.org 2003/07/09 13:58:19 | ||
12 | [key.c] | ||
13 | minor tweak: when generating the hex fingerprint, give strlcat the full | ||
14 | bound to the buffer, and add a comment below explaining why the | ||
15 | zero-termination is one less than the bound. markus@ ok | ||
10 | 16 | ||
11 | 20030708 | 17 | 20030708 |
12 | - (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]] | 18 | - (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]] |
@@ -680,4 +686,4 @@ | |||
680 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 686 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
681 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 687 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
682 | 688 | ||
683 | $Id: ChangeLog,v 1.2853 2003/07/14 06:43:42 dtucker Exp $ | 689 | $Id: ChangeLog,v 1.2854 2003/07/14 07:28:34 dtucker Exp $ |
@@ -32,7 +32,7 @@ | |||
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | 33 | */ |
34 | #include "includes.h" | 34 | #include "includes.h" |
35 | RCSID("$OpenBSD: key.c,v 1.53 2003/06/24 08:23:46 markus Exp $"); | 35 | RCSID("$OpenBSD: key.c,v 1.54 2003/07/09 13:58:19 avsm Exp $"); |
36 | 36 | ||
37 | #include <openssl/evp.h> | 37 | #include <openssl/evp.h> |
38 | 38 | ||
@@ -236,8 +236,10 @@ key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len) | |||
236 | for (i = 0; i < dgst_raw_len; i++) { | 236 | for (i = 0; i < dgst_raw_len; i++) { |
237 | char hex[4]; | 237 | char hex[4]; |
238 | snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]); | 238 | snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]); |
239 | strlcat(retval, hex, dgst_raw_len * 3); | 239 | strlcat(retval, hex, dgst_raw_len * 3 + 1); |
240 | } | 240 | } |
241 | |||
242 | /* Remove the trailing ':' character */ | ||
241 | retval[(dgst_raw_len * 3) - 1] = '\0'; | 243 | retval[(dgst_raw_len * 3) - 1] = '\0'; |
242 | return retval; | 244 | return retval; |
243 | } | 245 | } |