diff options
Diffstat (limited to 'src/tools/tor-gencert.c')
-rw-r--r-- | src/tools/tor-gencert.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c index 3809b22d43..e799df5cad 100644 --- a/src/tools/tor-gencert.c +++ b/src/tools/tor-gencert.c @@ -27,8 +27,6 @@ #include <assert.h> #endif -#define CRYPTO_PRIVATE - #include "compat.h" #include "../common/util.h" #include "../common/torlog.h" @@ -36,7 +34,7 @@ #include "address.h" #define IDENTITY_KEY_BITS 3072 -#define SIGNING_KEY_BITS 1024 +#define SIGNING_KEY_BITS 2048 #define DEFAULT_LIFETIME 12 /* These globals are set via command line options. */ @@ -304,6 +302,7 @@ load_identity_key(void) if (!identity_key) { log_err(LD_GENERAL, "Couldn't read identity key from %s", identity_key_file); + fclose(f); return 1; } fclose(f); @@ -324,6 +323,7 @@ load_signing_key(void) } if (!(signing_key = PEM_read_PrivateKey(f, NULL, NULL, NULL))) { log_err(LD_GENERAL, "Couldn't read siging key from %s", signing_key_file); + fclose(f); return 1; } fclose(f); @@ -549,6 +549,9 @@ main(int argc, char **argv) if (signing_key) EVP_PKEY_free(signing_key); tor_free(address); + tor_free(identity_key_file); + tor_free(signing_key_file); + tor_free(certificate_file); crypto_global_cleanup(); return r; |