Add PEM_read_bio_ex
authorBenjamin Kaduk <bkaduk@akamai.com>
Fri, 19 Feb 2016 03:24:27 +0000 (21:24 -0600)
committerRichard Levitte <levitte@openssl.org>
Mon, 8 May 2017 19:17:28 +0000 (21:17 +0200)
commit204afd81b12c71d625e89599c0eef33588afc1f0
tree8d53ed9eb9314f7342d12fba9e1647fb78419700
parentd396da33130aba2e77478d00fd369eb8d34bd8bf
Add PEM_read_bio_ex

The extended function includes a 'flags' argument to allow callers
to specify different requested behaviors.  In particular, callers can
request that temporary storage buffers are allocated from the secure heap,
which could be relevant when loading private key material.

Refactor PEM_read_bio to use BIO_mems instead of BUFs directly,
use some helper routines to reduce the overall function length, and make
some of the checks more reasonable.

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_err.c
crypto/pem/pem_lib.c
doc/man3/PEM_read_bio_ex.pod [new file with mode: 0644]
include/openssl/pem.h
util/libcrypto.num