[openssl/openssl] 56c1e4: 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/openssl-4.0/[email protected]>
  Branch: refs/heads/openssl-4.0
  Home:   https://github.com/openssl/openssl
  Commit: 56c1e4fc7625295283c22108746cb974229d9575
      https://github.com/openssl/openssl/commit/56c1e4fc7625295283c22108746cb974229d9575
  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
(cherry picked from commit eedaf1c2c46b5e511a603833a65a742085c01bb2)



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/openssl-4.0/c0568f-56c1e4%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.