diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-05-29 10:16:06 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-13 15:13:21 +0200 |
commit | 12bbcee21bf45665f0940f29e57b74281a861c1c (patch) | |
tree | 4741ef04ce22f1091cf479ac75b3c3a5bdd2251c /crypto/cmp/cmp_hdr.c | |
parent | Fill in transactionID on any error in OSSL_CMP_SRV_process_request() (diff) | |
download | openssl-12bbcee21bf45665f0940f29e57b74281a861c1c.tar.xz openssl-12bbcee21bf45665f0940f29e57b74281a861c1c.zip |
Make CMP server use same protection for response as for request
Also adds ossl_cmp_hdr_get_protection_nid() simplifying cmp_vfy.c
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11998)
Diffstat (limited to 'crypto/cmp/cmp_hdr.c')
-rw-r--r-- | crypto/cmp/cmp_hdr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/cmp/cmp_hdr.c b/crypto/cmp/cmp_hdr.c index 38b3bce3f5..4b98a598cd 100644 --- a/crypto/cmp/cmp_hdr.c +++ b/crypto/cmp/cmp_hdr.c @@ -41,6 +41,14 @@ int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr) return (int)pvno; } +int ossl_cmp_hdr_get_protection_nid(const OSSL_CMP_PKIHEADER *hdr) +{ + if (!ossl_assert(hdr != NULL) + || hdr->protectionAlg == NULL) + return NID_undef; + return OBJ_obj2nid(hdr->protectionAlg->algorithm); +} + ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const OSSL_CMP_PKIHEADER *hdr) { |