Skip to content

Fix Android handling of marshaling empty spans - #135360

Open
vcsjones wants to merge 2 commits into
dotnet:mainfrom
vcsjones:android-null-encrypt-decrypt
Open

vcsjones wants to merge 2 commits into
dotnet:mainfrom
vcsjones:android-null-encrypt-decrypt

Conversation

@vcsjones

@vcsjones vcsjones commented Oct 7, 2026

Copy link
Copy Markdown
Member

Some of the crypto APIs accept empty spans. If the span is "null" then these get marshaled as nullptr which some native shims and APIs reject, even if the length of the span is zero.

This changes our Android shim to pass non-null spans, and adds missing test coverage. The test coverage also caught the same problem for CipherFinal when one-shots are used.

Fixes #135333

@vcsjones vcsjones added this to the 12.0.0 milestone Oct 7, 2026
@vcsjones
vcsjones requested a review from bartonjs October 7, 2026 18:58
@vcsjones vcsjones self-assigned this Oct 7, 2026
@vcsjones
vcsjones deployed to copilot-pat-pool October 7, 2026 18:58 — with GitHub Actions Active
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

@vcsjones
vcsjones deployed to copilot-pat-pool October 7, 2026 19:00 — with GitHub Actions Active
@vcsjones

vcsjones commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-android

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

This branch was successfully deployed

1 active deployment
copilot-pat-pool — 76f537cd Deployed Oct 7, 2026 by vcsjones via conclusion #9810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] AesGcm.Encrypt/Decrypt with an empty payload crashes with SIGABRT in AndroidCryptoNative_CipherUpdate

2 participants