#include "crypto.h"
#include "ecdsagen.h"
-#include "utils.h"
+#include "logger.h"
static char *program_name;
-void logger(int level, int priority, const char *format, ...) {
+void logger(debug_t level, int priority, const char *format, ...) {
(void)level;
(void)priority;
va_list ap;
if(fp) {
if(!ecdsa_write_pem_private_key(key, fp)) {
fprintf(stderr, "Could not write ECDSA private key\n");
+ free(key);
return 1;
}
fclose(fp);
} else {
fprintf(stderr, "Could not open '%s' for writing: %s\n", argv[1], strerror(errno));
+ free(key);
return 1;
}
fprintf(stderr, "Could not write ECDSA public key\n");
}
+ free(key);
fclose(fp);
+ return 0;
} else {
fprintf(stderr, "Could not open '%s' for writing: %s\n", argv[2], strerror(errno));
+ free(key);
return 1;
}
-
- return 0;
}