openssl/crypto/cms
James Muir bd160912dc cms encrypt, better OBJ_nid2obj() return check
Fixes #22225

In OBJ_nid2obj(), if the NID does not have an OID, then a pointer to
the special "undefined" ASN1_OBJECT is returned.  Check for the
undefined-ASN1_OBJECT and return an error.  Also, add a test for this
in 80-test_cms.t.

Testing:

  #!/bin/bash -x

  shopt -s expand_aliases

  alias openssl="LD_LIBRARY_PATH=~/git/openssl ~/git/openssl/apps/openssl"

  echo "This is a confidential message.  It should be encrypted." > msg.txt

  ## this should fail b/c there is no OID for aes-256-ctr
  openssl cms -encrypt -in msg.txt -aes-256-ctr -out msg.txt.cms -recip demos/cms/signer.pem
  echo $?

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22392)
2023-10-18 16:49:11 +02:00
..
build.info
cms_asn1.c
cms_att.c
cms_cd.c
cms_dd.c
cms_dh.c Copyright year updates 2023-09-07 09:59:15 +01:00
cms_ec.c Copyright year updates 2023-09-07 09:59:15 +01:00
cms_enc.c cms encrypt, better OBJ_nid2obj() return check 2023-10-18 16:49:11 +02:00
cms_env.c Copyright year updates 2023-09-07 09:59:15 +01:00
cms_err.c CMS_add1_signer(): add missing ERR_raise() calls 2023-10-17 22:02:29 +02:00
cms_ess.c
cms_io.c
cms_kari.c
cms_lib.c Copyright year updates 2023-09-07 09:59:15 +01:00
cms_local.h Copyright year updates 2023-09-07 09:59:15 +01:00
cms_pwri.c
cms_rsa.c Copyright year updates 2023-09-07 09:59:15 +01:00
cms_sd.c CMS_add1_signer(): add missing ERR_raise() calls 2023-10-17 22:02:29 +02:00
cms_smime.c Copyright year updates 2023-09-07 09:59:15 +01:00