summaryrefslogtreecommitdiff
path: root/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'key.c')
-rw-r--r--key.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/key.c b/key.c
index 54318cbbf..060b63745 100644
--- a/key.c
+++ b/key.c
@@ -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"
35RCSID("$OpenBSD: key.c,v 1.54 2003/07/09 13:58:19 avsm Exp $"); 35RCSID("$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
172u_char* 172static u_char *
173key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) 173key_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
678Key * 676Key *
679key_from_blob(u_char *blob, u_int blen) 677key_from_blob(u_char *blob, int blen)
680{ 678{
681 Buffer b; 679 Buffer b;
682 char *ktype; 680 char *ktype;