summaryrefslogtreecommitdiff
path: root/dropbearconvert.c
diff options
context:
space:
mode:
Diffstat (limited to 'dropbearconvert.c')
-rw-r--r--dropbearconvert.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/dropbearconvert.c b/dropbearconvert.c
index 9e16fe7..958ced6 100644
--- a/dropbearconvert.c
+++ b/dropbearconvert.c
@@ -28,6 +28,8 @@
#include "buffer.h"
#include "dbutil.h"
#include "keyimport.h"
+#include "crypto_desc.h"
+#include "random.h"
static int do_convert(int intype, const char* infile, int outtype,
@@ -62,6 +64,9 @@ int main(int argc, char ** argv) {
const char* infile;
const char* outfile;
+ crypto_init();
+ seedrandom();
+
#ifdef DEBUG_TRACE
/* It's hard for it to get in the way _too_ much */
debug_trace = 1;
@@ -111,7 +116,7 @@ static int do_convert(int intype, const char* infile, int outtype,
const char* outfile) {
sign_key * key = NULL;
- char * keytype = NULL;
+ const char * keytype = NULL;
int ret = 1;
key = import_read(infile, NULL, intype);
@@ -121,16 +126,7 @@ static int do_convert(int intype, const char* infile, int outtype,
goto out;
}
-#ifdef DROPBEAR_RSA
- if (key->rsakey != NULL) {
- keytype = "RSA";
- }
-#endif
-#ifdef DROPBEAR_DSS
- if (key->dsskey != NULL) {
- keytype = "DSS";
- }
-#endif
+ keytype = signkey_name_from_type(key->type, NULL);
fprintf(stderr, "Key is a %s key\n", keytype);