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 /crypto | |
parent | 87d20a96510ecc78068865423e0fa127d17486de (diff) | |
download | openssl-new-fafa56a14fc4787060818715c151e1ef7b25e72f.tar.gz |
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 'crypto')
-rw-r--r-- | crypto/cmp/cmp_local.h | 1 | ||||
-rw-r--r-- | crypto/cmp/cmp_msg.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/crypto/cmp/cmp_local.h b/crypto/cmp/cmp_local.h index 92f192bb5f..4e33fd339c 100644 --- a/crypto/cmp/cmp_local.h +++ b/crypto/cmp/cmp_local.h @@ -896,7 +896,6 @@ ossl_cmp_certrepmessage_get0_certresponse(const OSSL_CMP_CERTREPMESSAGE *crm, int rid); X509 *ossl_cmp_certresponse_get1_certificate(EVP_PKEY *privkey, const OSSL_CMP_CERTRESPONSE *crep); -OSSL_CMP_MSG *ossl_cmp_msg_load(const char *file); /* from cmp_protect.c */ ASN1_BIT_STRING *ossl_cmp_calc_protection(const OSSL_CMP_MSG *msg, diff --git a/crypto/cmp/cmp_msg.c b/crypto/cmp/cmp_msg.c index d45a803677..2e24f49f3c 100644 --- a/crypto/cmp/cmp_msg.c +++ b/crypto/cmp/cmp_msg.c @@ -1008,13 +1008,15 @@ int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg) || ossl_cmp_msg_protect(ctx, msg); } -OSSL_CMP_MSG *ossl_cmp_msg_load(const char *file) +OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file) { OSSL_CMP_MSG *msg = NULL; BIO *bio = NULL; - if (!ossl_assert(file != NULL)) + if (file == NULL) { + CMPerr(0, CMP_R_NULL_ARGUMENT); return NULL; + } if ((bio = BIO_new_file(file, "rb")) == NULL) return NULL; |