version 1.49.2.2, 2003/09/16 21:20:26 |
version 1.50, 2003/02/04 09:32:08 |
|
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "key.h" |
#include "key.h" |
#include "rsa.h" |
#include "rsa.h" |
|
#include "ssh-dss.h" |
|
#include "ssh-rsa.h" |
#include "uuencode.h" |
#include "uuencode.h" |
#include "buffer.h" |
#include "buffer.h" |
#include "bufaux.h" |
#include "bufaux.h" |
|
|
return 0; |
return 0; |
} |
} |
|
|
u_char* |
static u_char * |
key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) |
key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) |
{ |
{ |
const EVP_MD *md = NULL; |
const EVP_MD *md = NULL; |
|
|
for (i = 0; i < dgst_raw_len; i++) { |
for (i = 0; i < dgst_raw_len; i++) { |
char hex[4]; |
char hex[4]; |
snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]); |
snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]); |
strlcat(retval, hex, dgst_raw_len * 3 + 1); |
strlcat(retval, hex, dgst_raw_len * 3); |
} |
} |
|
|
/* Remove the trailing ':' character */ |
|
retval[(dgst_raw_len * 3) - 1] = '\0'; |
retval[(dgst_raw_len * 3) - 1] = '\0'; |
return retval; |
return retval; |
} |
} |
|
|
xfree(blob); |
xfree(blob); |
return -1; |
return -1; |
} |
} |
k = key_from_blob(blob, (u_int)n); |
k = key_from_blob(blob, n); |
xfree(blob); |
xfree(blob); |
if (k == NULL) { |
if (k == NULL) { |
error("key_read: key_from_blob %s failed", cp); |
error("key_read: key_from_blob %s failed", cp); |
|
|
} |
} |
|
|
Key * |
Key * |
key_from_blob(u_char *blob, u_int blen) |
key_from_blob(u_char *blob, int blen) |
{ |
{ |
Buffer b; |
Buffer b; |
char *ktype; |
char *ktype; |