diff options
Diffstat (limited to 'key.c')
-rw-r--r-- | key.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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.54 2003/07/09 13:58:19 avsm Exp $"); | 35 | RCSID("$OpenBSD: key.c,v 1.51 2003/02/12 09:33:04 markus Exp $"); |
36 | 36 | ||
37 | #include <openssl/evp.h> | 37 | #include <openssl/evp.h> |
38 | 38 | ||
@@ -169,7 +169,7 @@ key_equal(Key *a, Key *b) | |||
169 | return 0; | 169 | return 0; |
170 | } | 170 | } |
171 | 171 | ||
172 | u_char* | 172 | static u_char * |
173 | key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) | 173 | key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) |
174 | { | 174 | { |
175 | const EVP_MD *md = NULL; | 175 | const EVP_MD *md = NULL; |
@@ -236,10 +236,8 @@ 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 + 1); | 239 | strlcat(retval, hex, dgst_raw_len * 3); |
240 | } | 240 | } |
241 | |||
242 | /* Remove the trailing ':' character */ | ||
243 | retval[(dgst_raw_len * 3) - 1] = '\0'; | 241 | retval[(dgst_raw_len * 3) - 1] = '\0'; |
244 | return retval; | 242 | return retval; |
245 | } | 243 | } |
@@ -440,7 +438,7 @@ key_read(Key *ret, char **cpp) | |||
440 | xfree(blob); | 438 | xfree(blob); |
441 | return -1; | 439 | return -1; |
442 | } | 440 | } |
443 | k = key_from_blob(blob, (u_int)n); | 441 | k = key_from_blob(blob, n); |
444 | xfree(blob); | 442 | xfree(blob); |
445 | if (k == NULL) { | 443 | if (k == NULL) { |
446 | error("key_read: key_from_blob %s failed", cp); | 444 | error("key_read: key_from_blob %s failed", cp); |
@@ -676,7 +674,7 @@ key_names_valid2(const char *names) | |||
676 | } | 674 | } |
677 | 675 | ||
678 | Key * | 676 | Key * |
679 | key_from_blob(u_char *blob, u_int blen) | 677 | key_from_blob(u_char *blob, int blen) |
680 | { | 678 | { |
681 | Buffer b; | 679 | Buffer b; |
682 | char *ktype; | 680 | char *ktype; |