RT2547: Tighten perms on generated privkey files
authorRich Salz <rsalz@akamai.com>
Sat, 2 May 2015 14:01:33 +0000 (10:01 -0400)
committerRich Salz <rsalz@openssl.org>
Mon, 15 Jun 2015 22:26:56 +0000 (18:26 -0400)
commit3b061a00e39d2e4ad524ff01cbdc0c53fe8171ee
tree0389af5c46f6c56ab6f88c737f55aa07493dfd39
parentd31fb0b5b341aa7883b487d07e6a56d216224e25
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>
22 files changed:
CHANGES
apps/apps.c
apps/apps.h
apps/dsa.c
apps/dsaparam.c
apps/ec.c
apps/ecparam.c
apps/gendsa.c
apps/genpkey.c
apps/genrsa.c
apps/openssl.c
apps/opt.c
apps/passwd.c
apps/pkcs12.c
apps/pkcs8.c
apps/pkey.c
apps/req.c
apps/rsa.c
apps/s_cb.c
apps/s_client.c
apps/s_server.c
apps/x509.c