Skip to content

Add runtime-toggleable Cryptor/Message tracing + quick-reference docs#85

Merged
matt2005 merged 1 commit intodevelopfrom
chore/aa-runtime-trace-opencardev-develop
Mar 14, 2026
Merged

Add runtime-toggleable Cryptor/Message tracing + quick-reference docs#85
matt2005 merged 1 commit intodevelopfrom
chore/aa-runtime-trace-opencardev-develop

Conversation

@matt2005
Copy link

Summary

  • Add runtime-toggleable trace instrumentation in Cryptor::decrypt.
  • Add runtime-toggleable trace instrumentation in MessageInStream::receiveFramePayloadHandler.
  • Document trace toggles and sample usage in QUICK_REFERENCE.md.

Why

Projection diagnostics were requiring rebuilds for each additional log point. This change enables targeted decrypt/message tracing at runtime via environment variables.

Runtime toggles

  • AASDK_TRACE_CRYPTOR (0/1)
  • AASDK_TRACE_CRYPTOR_SAMPLE_EVERY (1-1000)
  • AASDK_TRACE_MESSAGE (0/1)
  • AASDK_TRACE_MESSAGE_VIDEO_ONLY (0/1)
  • AASDK_TRACE_MESSAGE_SAMPLE_EVERY (1-1000)

Expected log tags

  • [CryptorTrace] decrypt-read
  • [CryptorTrace] decrypt-drained
  • [MessageTrace] encrypted-pass-through
  • [MessageTrace] decrypt
  • [MessageTrace] resolve

Validation

  • Built and installed aasdk from this branch locally.
  • Verified runtime trace output appears when toggles are enabled.

@matt2005 matt2005 merged commit f8a8651 into develop Mar 14, 2026
4 checks passed
@matt2005 matt2005 deleted the chore/aa-runtime-trace-opencardev-develop branch March 14, 2026 23:31
matt2005 added a commit that referenced this pull request Mar 15, 2026
* fix: USB AOAP recovery, TLS bridge guard, SSL decrypt drain, diagnostics (#84)

* Fix SSL decrypt handling and migrate cert install to /etc/aasdk

- handle SSL WANT_READ/WANT_WRITE as partial frame in Cryptor decrypt\n- add richer SSL diagnostics in SSLWrapper/Cryptor\n- move cert/key install path from /etc/openauto to /etc/aasdk\n- add debian postinst migration and permission/ownership fixups

* fix: USB AOAP recovery, TLS bridge, SSL decrypt drain, diagnostics

- AOAPDevice: detect LIBUSB_ERROR_BUSY on claimInterface and attempt
  releaseInterface + retry before throwing to handle stale ownership
  after abrupt transport teardown

- MessageInStream: conditionally inject ENCAPSULATED_SSL prefix (MessageId 3)
  only when the incoming payload looks like a TLS record (content-type
  0x14-0x17, version byte 0x03); plain payloads such as version responses
  are no longer misclassified; promote frame/payload logs to info level

- Cryptor: simplify SSL decrypt drain loop to pure while(true) with
  fixed 2048-byte read chunks; remove overhead/expected-bytes heuristics
  that caused premature loop exit; demote WANT_READ/WANT_WRITE to debug

- ControlServiceChannel: add info-level logs for sendVersionRequest
  (logs major/minor) and sendHandshake (logs payload size); promote
  incoming MessageId log to info for runtime visibility

- USBTransport: add diagnostic logs for doSend submission, sendComplete,
  sendError, enqueueReceive, receiveComplete and receiveError including
  endpoint address, byte count and error code/native code

* Add runtime-toggleable cryptor/message tracing and docs (#85)

* Address Copilot PR review follow-ups (#87)

* Add MessageInStream regression tests and run CI unit tests on PR/main/develop (#88)
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.

1 participant