Make PEM_read_{,bio_}PrivateKey use secmem
authorBenjamin Kaduk <bkaduk@akamai.com>
Fri, 19 Feb 2016 23:36:52 +0000 (17:36 -0600)
committerRichard Levitte <levitte@openssl.org>
Mon, 8 May 2017 19:20:31 +0000 (21:20 +0200)
commit44612e0a817d1cf25df776b00993820f612f3cd3
tree3147cd6eca8983e6d926b3351d833d5260d15d9c
parent7671342e550ed2de676b23c79d0e7f45a381c76e
Make PEM_read_{,bio_}PrivateKey use secmem

We now have a version of PEM_read_bytes that can use temporary
buffers allocated from the secure heap; use them to handle this
sensitive information.

Note that for PEM_read_PrivateKey, the i/o still goes through
stdio since the input is a FILE pointer.  Standard I/O performs
additional buffering, which cannot be changed to use the OpenSSL
secure heap for temporary storage.  As such, it is recommended
to use BIO_new_file() and PEM_read_bio_PrivateKey() instead.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1700)
crypto/pem/pem_pkey.c