Skip to content

Add digest context copy function - #158

Merged
Maxwell Moyer-McKee (mamckee) merged 2 commits into
mainfrom
mamckee-digest-context-copy
Mar 4, 2026
Merged

Add digest context copy function#158
Maxwell Moyer-McKee (mamckee) merged 2 commits into
mainfrom
mamckee-digest-context-copy

Conversation

@mamckee

Copy link
Copy Markdown
Collaborator

This PR adds the provider context copy function for newer versions of OpenSSL. This function copies the state into an existing context object instead of creating a new context object like context duplication.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for OpenSSL’s newer digest “copy context into an existing ctx” provider callback (OSSL_FUNC_DIGEST_COPYCTX) to complement the existing “duplicate context” (DUPCTX) implementation.

Changes:

  • Introduces p_scossl_digest_copy_ctx for copying digest state into an existing SCOSSL_DIGEST_CTX when OSSL_FUNC_DIGEST_COPYCTX is available.
  • Updates digest dispatch table macro generation to conditionally include OSSL_FUNC_DIGEST_COPYCTX for newer OpenSSL versions.
  • Refactors the shared digest macro to separate “common helper function implementations” from “dispatch table construction”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
SymCryptProvider/src/digests/p_scossl_digest_common.h Declares copyctx and conditionally adds it to the digest dispatch macro.
SymCryptProvider/src/digests/p_scossl_digest_common.c Implements p_scossl_digest_copy_ctx using SymCrypt’s stateCopyFunc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SymCryptProvider/src/digests/p_scossl_digest_common.c
Comment thread SymCryptProvider/src/digests/p_scossl_digest_common.h
@mamckee
Maxwell Moyer-McKee (mamckee) marked this pull request as ready for review February 18, 2026 23:19
@mamckee Maxwell Moyer-McKee (mamckee) changed the title [DRAFT] Add digest context copy function Add digest context copy function Feb 18, 2026

@MS-megliu MS-megliu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@mamckee
Maxwell Moyer-McKee (mamckee) merged commit 855de79 into main Mar 4, 2026
9 checks passed
@mamckee
Maxwell Moyer-McKee (mamckee) deleted the mamckee-digest-context-copy branch March 4, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants