Repository navigation
Fix documentation errors in Android.Crypto.Hpke (R113, pass 3) - #1991
Merged
jonathanpeppers merged 3 commits intoNov 28, 2026
Merged
Conversation
Java.Lang.Object peers make their own JNI reference; transfer selects whether the incoming reference is deleted and whether the peer is registered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sender.Builder.setApplicationInfo and setSenderKey do not null-check, and HpkeSpi.engineInitSender declares both values @nullable. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for this documentation-only update clarifying JNI reference handling and sender-builder parameter nullability.
No open issues 🎉
What changed in this PR
This documentation-only PR corrects parameter descriptions in Android.Crypto.Hpke, aligning them with runtime reference handling and sender-builder null behavior. No API signatures or executable code change.
Changes:
- Clarifies JNI reference release and peer registration for constructors in nine files, consistent with the wording used in #1941.
- Removes incorrect non-null restrictions from
Sender.Builder.SetApplicationInfoandSetSenderKey.
| File | Description |
|---|---|
docs/xml/Android.Crypto.Hpke/Sender+Builder.xml |
Corrects JNI handling and two parameter null restrictions. |
docs/xml/Android.Crypto.Hpke/Sender.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/Recipient+Builder.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/Recipient.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/Message.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/KemParameterSpec.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/KdfParameterSpec.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/Hpke.xml |
Clarifies constructor JNI reference handling. |
docs/xml/Android.Crypto.Hpke/AeadParameterSpec.xml |
Clarifies constructor JNI reference handling. |
Review effort: Balanced
Sender.java declares setApplicationInfo(@nonnull byte[]) at line 127 and setSenderKey(@nonnull PrivateKey) at line 138. The text "This value cannot be null." states that public caller contract, so the earlier removal (40a76fd) was wrong. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@dalexsoto review |
dalexsoto
approved these changes
Nov 28, 2026
dalexsoto
left a comment
Member
There was a problem hiding this comment.
Reviewed the JNI handle-ownership parameter documentation across all nine HPKE types against the runtime reference-handling implementation. No blocking issues found.
jonathanpeppers
deleted the
jonathanpeppers-review-android-crypto-hpke-docs-r113
branch
November 28, 2026 16:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
abbc85c26baa7bfb67eafe24cb339b1c3db94da0transferparam edits, and pinned source lines prove each one.↑ All XML files in the namespace parse, and
git diff --checkis clean.↑ The gemini-4-argon rubber-duck review of this head found no problems.
↓ OpenPublishing.Build and the Copilot review for this head are pending.
transferselects release and registration.Scope
Pass-3 review of the AI-changed documentation in
Android.Crypto.Hpke(12 files: 10 type files,ns-Android.Crypto.Hpke.xml, andIHpkeSpi.xml).IHpkeSpi.xmlhas no AI-changed Docs text.ThresholdClass/ThresholdType/JniPeerMembersboilerplate. Each one still has its own row, checked against the dotnet/android@9bc18c75 generator (ClassInvokers.cs,PeerMembersField.cs) andXAPeerMembers.cs. Per the kickoff, they are not changed here.Fixes
transferparam on the(IntPtr, JniHandleOwnership)constructors (9 files).AeadParameterSpec,Hpke,KdfParameterSpec,KemParameterSpec,Message,Recipient,Recipient.Builder,Sender, andSender.Builder.Java.Lang.Object. InObject.SetHandle,ConstructPeergetsCopy(orCopyAndDoNotRegister), so the peer makes its own reference. After that,JNIEnv.DeleteRef(value, transfer)releases the incoming reference.src/Mono.Android/Java.Lang/Object.cs:35-38,110-118andsrc/Mono.Android/Android.Runtime/JNIEnv.cs:360-372,388-393.Reverted:
Sender.Builder"This value cannot be null."applicationInfoandsenderKeyparams. Commit abbc85c restores it.Sender.java:127declaressetApplicationInfo(@NonNull byte[] applicationInfo), andSender.java:138declaressetSenderKey(@NonNull PrivateKey senderKey). The sentence states this public caller contract. The missing runtime check and the@Nullableparameters on the internalHpkeSpido not change that contract.Sender+Builder.xmlnow differs frommainonly in thetransferparam.Sources:
source-37.2_r01.zip(android/crypto/hpke/*.java,com/android/org/conscrypt/HpkeImpl.java,OpenSSLProvider.java), RFC 9180, and dotnet/android@9bc18c75.Uncertain findings
None.
I examined one item and found no error.
KemParameterSpecremarks say "The Conscrypt provider supports DHKEM_X25519_HKDF_SHA256." Conscrypt also registersMLKEM_*andXWINGsuites (OpenSSLProvider.java:776-791). Those suites have noKemParameterSpecfield, and the sentence does not say "only". Thus, the sentence is correct as written.Checks
docs/xml/Android.Crypto.Hpkeparse.git diff --check origin/main HEADis clean.index.xmldid not change.assistant_usage_eventsshows 11 rows for sub-agent3f725511-f3ab-4d85-a722-16046e182080, all with modelgemini-4-argon, from 2026-11-28T16:25:51Z to 16:29:01Z.