summaryrefslogtreecommitdiffstats
path: root/apps/apps.h
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-02 10:01:33 -0400
committerRich Salz <rsalz@openssl.org>2015-06-15 18:26:56 -0400
commit3b061a00e39d2e4ad524ff01cbdc0c53fe8171ee (patch)
tree0389af5c46f6c56ab6f88c737f55aa07493dfd39 /apps/apps.h
parentd31fb0b5b341aa7883b487d07e6a56d216224e25 (diff)
RT2547: Tighten perms on generated privkey files
When generating a private key, try to make the output file be readable only by the owner. Put it in CHANGES file since it might be noticeable. Add "int private" flag to apps that write private keys, and check that it's set whenever we do write a private key. Checked via assert so that this bug (security-related) gets fixed. Thanks to Viktor for help in tracing the code-paths where private keys are written. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Diffstat (limited to 'apps/apps.h')
-rw-r--r--apps/apps.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/apps.h b/apps/apps.h
index a8652a1bb7..b83d4b2aee 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -113,6 +113,7 @@
# define HEADER_APPS_H
# include "e_os.h"
+# include <assert.h>
# include <openssl/bio.h>
# include <openssl/x509.h>
@@ -153,6 +154,7 @@ extern BIO *bio_out;
extern BIO *bio_err;
BIO *dup_bio_in(void);
BIO *dup_bio_out(void);
+BIO *bio_open_owner(const char *filename, const char *mode, int private);
BIO *bio_open_default(const char *filename, const char *mode);
BIO *bio_open_default_quiet(const char *filename, const char *mode);
CONF *app_load_config(const char *filename);