Files
openssl/apps
herbenderbler 80b7e49c27 Use mmap for pkeyutl -rawin and dgst one-shot input
When using openssl pkeyutl -rawin or openssl dgst for one-shot sign/verify
(e.g. Ed25519, Ed448), file input is now read via mmap() on Unix where
supported, avoiding a full buffer allocation and copy. Large files are
supported without doubling memory use; on failure of the mmap path we
do not fall back to the buffer path.

- Add app_mmap_file() in apps/lib/apps.c: stat/open/mmap/close, tri-state
  return (1 mapped, 0 size zero, -1 error). Parameter err_bio avoids
  shadowing global bio_err (-Wshadow).
- apps/pkeyutl.c and apps/dgst.c: use app_mmap_file(); single exit for
  mmap path in pkeyutl; dgst includes apps.h first for _FILE_OFFSET_BITS;
  do_fp_oneshot_sign returns EXIT_SUCCESS/EXIT_FAILURE like do_fp(); no
  fallback when mmap attempted but fails.
- pkeyutl mmap/buffer path: pass filesize to EVP_DigestVerify and
  EVP_DigestSign (review suggestion, avoids casting buf_len).
- Error messages: per-file messages for stat/size (dgst, pkeyutl); CHANGES.md
  "Unix-like" and "16 MB" (documentation style).
- Centralize _FILE_OFFSET_BITS and mmap includes in apps/include/apps.h.
- Tests: pkeyutl/dgst oneshot from file, no-fallback regression tests;
  use srctop_dir for test paths; stderr patterns for mmap errors.
- Docs: man pages and CHANGES.md.

CI fixes: return failure from dgst one-shot sign when mmap fails; treat
non-regular paths as mmap errors in app_mmap_file() and pkeyutl; reject
directories before mmap.

Addresses review feedback from DDvO, npajkovsky, and vdukhovni (PR #30429).

Fixes #11677

Co-authored-by: Viktor Dukhovni <viktor1ghub@dukhovni.org>
Co-authored-by: David von Oheimb <DDvO@users.noreply.github.com>

Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Fri Mar 27 16:25:33 2026
(Merged from https://github.com/openssl/openssl/pull/30429)
2026-03-27 17:25:31 +01:00
..
2024-04-25 11:07:20 +02:00
2026-03-10 14:37:52 +00:00
2025-09-02 13:05:45 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-12 11:47:13 +01:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2020-05-13 06:28:36 +02:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00
2026-03-10 14:37:52 +00:00
2025-12-09 00:28:19 -07:00
2025-12-09 00:28:19 -07:00
2026-03-10 14:37:52 +00:00