[codex] add signed device identity to connect handshake#6
Open
gamerg21 wants to merge 1 commit intonewmaterialco:mainfrom
Open
[codex] add signed device identity to connect handshake#6gamerg21 wants to merge 1 commit intonewmaterialco:mainfrom
gamerg21 wants to merge 1 commit intonewmaterialco:mainfrom
Conversation
|
I had the same issue and about to create a PR and saw you already have done it :)) |
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.
Summary
Chowder iOS was failing
connectagainst gateways that enforce device authentication because the client did not send aparams.devicepayload. This change adds a persistent Ed25519 device identity, signs the required v2 payload, and sends device proof in theconnectrequest.User Impact
Before this fix, users hit connection/auth failures even with a valid gateway token because the gateway required signed device identity fields (
id,publicKey,signature,signedAt,nonce) that were missing.Root Cause
The iOS handshake only sent
auth.tokenand omitted the device identity/signature flow. It also had no persisted device keypair or device token lifecycle handling.Fix Details
DeviceIdentityServiceto:Curve25519.Signing.PrivateKey)deviceIdas lowercase hexsha256(publicKeyRaw)v2|<deviceId>|<clientId>|<clientMode>|<role>|<comma_scopes>|<signedAtMs>|<token>|<nonce>KeychainServicewith binary save/load methods for raw private-key bytes.ChatService.sendConnectRequestto:hello-ok.auth.deviceTokenover raw gateway token on reconnectparams.device = { id, publicKey, signature, signedAt, nonce }openclaw-ios,ui,operator, scopes) aligned with the signed payload.hello-okhandling to persistauth.deviceTokenfor subsequent connects.Pairing Behavior
After this change, first connect may return
NOT_PAIREDuntil host approval is granted (openclaw devices listthenopenclaw devices approve --latest). Reconnect after approval.Validation
xcodebuild -project Chowder/Chowder.xcodeproj -scheme Chowder -configuration Debug -sdk iphonesimulator build CODE_SIGNING_ALLOWED=NOxcode-selectpoints to CommandLineTools only).deviceparams and device token persistence.