8000 The live GS1 lane still compiles its vendor key, so it cannot compile against the redaction branch · Issue #191 · shroominic/OpenGlucose · GitHub
[go: up one dir, main page]

Skip to content

The live GS1 lane still compiles its vendor key, so it cannot compile against the redaction branch #191

Open

Description

@shroominic

What breaks

The live GS1 lane resolves its link credential from a compiled default and
masks every frame with a compiled default key:

// packages/cgm_cbio/lib/src/cbio_glucose_session.dart (17db5b4)
abstract interface class CbioAuthMaterialProvider {
  Future<List<int>> read();
}

final class CbioCompiledAuthMaterialProvider implements CbioAuthMaterialProvider {
  const CbioCompiledAuthMaterialProvider([this.material = cbioVendorAuthMaterial]);
  ...
}

// packages/cgm_cbio/lib/src/cbio_crypto.dart (17db5b4)
List<int> unmaskCbioFrame(List<int> masked) =>
    _xorWithStream(masked, cbioVendorStreamKey);

fix/cbio-credential-redaction (#166) deletes those constants and gives every
function an explicit key:/material:. The two branches fork from 4702025
and edit the same files, so the lane cannot compile against the redacted API.
Cherry-picking #166 onto the lane tip reproduces it immediately:

cd packages/cgm_cbio && flutter test
lib/src/cbio_glucose_session.dart:603:40: Error: Required named parameter 'key' must be provided.
        final plaintext = unmaskCbioFrame(_reassemblyBuffer);
lib/src/cbio_glucose_session.dart:671:38: Error: Required named parameter 'key' must be provided.
      final plaintext = unmaskCbioFrame(masked);
00:00 +0 -8: Some tests failed.
cd openhealth && flutter analyze
error • The named parameter 'key' is required, but there's no corresponding argument
  • integration_test/cbio_live_capture_test.dart:63:21 • missing_required_argument

Why it matters

The lane is the only path that turns a real GS1 sensor into app readings, and
the redaction branch is the only path that gets the vendor material out of a
public repository. As written they cannot both land: #166 merges and the lane
stops compiling, or the lane ships and #166 stays blocked. Every rebase of the
lane onto the redaction branch is a merge conflict in cbio_crypto.dart,
cbio_vendor_frames.dart, and the session.

The lane is also still fail-open at its most sensitive step. A build that never
received the material gets CbioCompiledAuthMaterialProvider's compiled
credential and writes an authentication frame anyway, so "this build cannot
authenticate" is indistinguishable from "the sensor rejected us" in the session
snapshot.

Next step

Adopt the injected-material API in the lane: read one CbioCredentialSource
per session, pass key: and material: explicitly at every call site, and let
a build without the material fail closed with a configuration problem before it
opens the link.

Activity

  1. shroominic commented on Sep 18, 2026

    @shroominic
    OwnerAuthor

    Resolved by #192 on fix/cbio-credential-source-adoption, based on feature/cbio-gs1-app-live (17db5b4).

    The branch is two commits: 0d3f763 is #166 verbatim, cherry-picked from 7fa477c on fix/cbio-credential-redaction, and 9e2105a is the adoption. Carrying #166 keeps the branch compiling and passing on its own; if #166 lands first, the diff reduces to 9e2105a with identical content.

    Verified: cgm_cbio +81 (2 skipped), openhealth +480, flutter analyze clean in both plus integration_test. RED is recorded in the PR against 0d3f763 - seven key: errors in the session, eleven in its tests, one in the capture harness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0