[openssl/openssl] eedaf1: pkcs7: use PKCS7_get_octet_string in PKCS7_stream ...

"'Abel Thomas' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: eedaf1c2c46b5e511a603833a65a742085c01bb2
      https://github.com/openssl/openssl/commit/eedaf1c2c46b5e511a603833a65a742085c01bb2
  Author: Abel Thomas <[email protected]>
  Date:   2026-08-18 (Tue, 18 Aug 2026)

  Changed paths:
    M crypto/pkcs7/pk7_lib.c
    M test/pkcs7_test.c

  Log Message:
  -----------
  pkcs7: use PKCS7_get_octet_string in PKCS7_stream signed arm

Direct access to `p7->d.sign->contents->d.data` skips the content-type
check: if the inner eContentType is a non-standard OID the ADB sets
d.other (16 bytes) instead of d.data (24 bytes), and the subsequent
os->flags write lands out of bounds.

Replace with `PKCS7_get_octet_string()`, which returns NULL for any type
that is not `NID_pkcs7_data`, matching the guard already used by
`PKCS7_ctrl()` and `PKCS7_dataDecode()`.

Added a unit-test (`pkcs7_stream_non_data_test`) to validate the change.

Fixes #31681

Reviewed-by: Bob Beck <[email protected]>
Reviewed-by: Jakub Zelenka <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
Merge-date: Tue Aug 18 07:47:41 2026
Merged-from: https://github.com/openssl/openssl/pull/31722



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/master/0c0c96-eedaf1%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.