Fix Read Modified, embedded NVT fill bytes and printer Bind reset #362

Manually merged
binjovi-bot merged 2 commits from feature/read-modified-nvt-fill-printer-bind into trunk 2026-10-26 10:15:11 +00:00
Owner

Three protocol defects, each with a failing test first:

  • Operator Enter and PF keys built the Read Modified reply from the input
    model, which holds only unprotected fields, and the builder skipped
    protected fields as well. A protected field whose MDT bit the host set
    was never returned, although the host Read Modified path in the same
    file already sent every MDT field. IBM GA23-0059 transfers each field
    that has MDT set. transmit now walks the field attributes through
    collectModifiedFields3270, which fails closed above the field limit
    instead of sending a partial list. Short-read AIDs send only the AID
    byte and do not depend on the field count.
  • The ECMA-48 parser for embedded NVT data ignored NUL and DEL inside a
    control sequence and inside a control string, but not between ESC and
    the rest of an escape sequence, in an intermediate sequence, or in a
    string terminator. ESC NUL [ 2 J ended the sequence and drew [2J on
    the screen. ECMA-48 8.3.88 and F.8.1 define both bytes as fill, so all
    five phases now skip them.
  • A TN3270E printer session kept its Bind state and a partial record when
    the host withdrew and negotiated TN3270E again. A new LU could then send
    3270 or SCS data before its own BIND-IMAGE. RFC 2355 section 10.3 does
    not allow that. The session now discards the Bind and the record on an
    option change, as the display session already does.

Cleanup: Screen.repeatToExclusive had no caller since the 3270 path got
its own attribute-aware repeat in render3270.zig; STYLE.md 4.6 removes
it. Two comments cited another client's header files; they now cite
GA23-0059. The Makefile fuzz comment described a Zig 0.16 test-runner
defect; Zig 0.17 reports that the suite has no std.testing.fuzz test.

Checks: zig fmt --check, zig build check, the package contract and
target selection scripts, all in the zig-builder:v22 image.

Three protocol defects, each with a failing test first: - Operator Enter and PF keys built the Read Modified reply from the input model, which holds only unprotected fields, and the builder skipped protected fields as well. A protected field whose MDT bit the host set was never returned, although the host Read Modified path in the same file already sent every MDT field. IBM GA23-0059 transfers each field that has MDT set. `transmit` now walks the field attributes through `collectModifiedFields3270`, which fails closed above the field limit instead of sending a partial list. Short-read AIDs send only the AID byte and do not depend on the field count. - The ECMA-48 parser for embedded NVT data ignored NUL and DEL inside a control sequence and inside a control string, but not between ESC and the rest of an escape sequence, in an intermediate sequence, or in a string terminator. `ESC NUL [ 2 J` ended the sequence and drew `[2J` on the screen. ECMA-48 8.3.88 and F.8.1 define both bytes as fill, so all five phases now skip them. - A TN3270E printer session kept its Bind state and a partial record when the host withdrew and negotiated TN3270E again. A new LU could then send 3270 or SCS data before its own BIND-IMAGE. RFC 2355 section 10.3 does not allow that. The session now discards the Bind and the record on an option change, as the display session already does. Cleanup: `Screen.repeatToExclusive` had no caller since the 3270 path got its own attribute-aware repeat in render3270.zig; STYLE.md 4.6 removes it. Two comments cited another client's header files; they now cite GA23-0059. The Makefile `fuzz` comment described a Zig 0.16 test-runner defect; Zig 0.17 reports that the suite has no `std.testing.fuzz` test. Checks: `zig fmt --check`, `zig build check`, the package contract and target selection scripts, all in the zig-builder:v22 image.
Fix Read Modified, embedded NVT fill bytes and printer Bind reset
Some checks failed
binjovi/ci Binjovi failed the frozen plan
763712c9f3
Three protocol defects, each with a failing test first:

- Operator Enter and PF keys built the Read Modified reply from the input
  model, which holds only unprotected fields, and the builder skipped
  protected fields as well. A protected field whose MDT bit the host set
  was never returned, although the host Read Modified path in the same
  file already sent every MDT field. IBM GA23-0059 transfers each field
  that has MDT set. `transmit` now walks the field attributes through
  `collectModifiedFields3270`, which fails closed above the field limit
  instead of sending a partial list. Short-read AIDs send only the AID
  byte and do not depend on the field count.
- The ECMA-48 parser for embedded NVT data ignored NUL and DEL inside a
  control sequence and inside a control string, but not between ESC and
  the rest of an escape sequence, in an intermediate sequence, or in a
  string terminator. `ESC NUL [ 2 J` ended the sequence and drew `[2J` on
  the screen. ECMA-48 8.3.88 and F.8.1 define both bytes as fill, so all
  five phases now skip them.
- A TN3270E printer session kept its Bind state and a partial record when
  the host withdrew and negotiated TN3270E again. A new LU could then send
  3270 or SCS data before its own BIND-IMAGE. RFC 2355 section 10.3 does
  not allow that. The session now discards the Bind and the record on an
  option change, as the display session already does.

Cleanup: `Screen.repeatToExclusive` had no caller since the 3270 path got
its own attribute-aware repeat in render3270.zig; STYLE.md 4.6 removes
it. Two comments cited another client's header files; they now cite
GA23-0059. The Makefile `fuzz` comment described a Zig 0.16 test-runner
defect; Zig 0.17 reports that the suite has no `std.testing.fuzz` test.

Checks: `zig fmt --check`, `zig build check`, the package contract and
target selection scripts, all in the zig-builder:v22 image.
Add a std.testing.fuzz entry for the ECMA-48 parser
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2200f2fd95
`make fuzz` ran `zig build test --fuzz` against a suite with no
`std.testing.fuzz` test, so Zig 0.17 answered "no fuzz tests found".
`fuzzFeed` in src/ansi.zig gives the coverage-guided fuzzer an entry: a
256-byte string and a screen geometry from the Smith generator. The test
checks that the cursor and the parameter count stay in bounds, and that
one `feed` call and one call for each byte give the same parser state
and screen. Outside fuzz mode the runner feeds the three corpus strings
and an empty string, so the property also runs in `zig build check`.

The Makefile and the hostserver datastream comment described a Zig 0.16
test-runner defect that no longer applies; they now point at the entry.

Checks: `zig fmt --check`, `zig test src/ansi.zig` (59 tests, 1 fuzz
test found), 100 s of `zig build test --fuzz`, and the full check
profile, all in the zig-builder:v22 image.
binjovi-bot manually merged commit 2200f2fd95 into trunk 2026-10-26 10:15:11 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/zelnet!362
No description provided.