diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-07-11 11:36:48 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-07-30 20:14:49 +0200 |
commit | fafa56a14fc4787060818715c151e1ef7b25e72f (patch) | |
tree | 56df8de045d1ffd883d39302fa7fb97276fe8b88 /apps/cmp.c | |
parent | 87d20a96510ecc78068865423e0fa127d17486de (diff) |
Export ossl_cmp_msg_load() as OSSL_CMP_MSG_read(), use it in apps/cmp.c
Fixes #12403
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12421)
Diffstat (limited to 'apps/cmp.c')
-rw-r--r-- | apps/cmp.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index 102146a275..20e7f6ac84 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -965,7 +965,6 @@ static int write_PKIMESSAGE(const OSSL_CMP_MSG *msg, char **filenames) static OSSL_CMP_MSG *read_PKIMESSAGE(char **filenames) { char *file; - BIO *bio; OSSL_CMP_MSG *ret; if (filenames == NULL) { @@ -979,15 +978,10 @@ static OSSL_CMP_MSG *read_PKIMESSAGE(char **filenames) file = *filenames; *filenames = next_item(file); - bio = BIO_new_file(file, "rb"); - if (bio == NULL) { - CMP_err1("Cannot open file '%s' for reading", file); - return NULL; - } - ret = d2i_OSSL_CMP_MSG_bio(bio, NULL); + + ret = OSSL_CMP_MSG_read(file); if (ret == NULL) CMP_err1("Cannot read PKIMessage from file '%s'", file); - BIO_free(bio); return ret; } |