Skip to content

Commit 9d35123

Browse files
committed
update instructions
1 parent 8de2672 commit 9d35123

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/instructions/merge/merge-details.instructions.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,32 @@ FUNCTION add_source_to_project(project_file, source_file):
215215
insert_into_project_file(project_file, new_line)
216216
```
217217

218+
### Pattern 4: OpenSSH 10.3 Split-sshd State Ordering (Windows)
219+
220+
When upstream changes split pre-auth work between `sshd-session` and `sshd-auth`, preserve the state/message ordering exactly.
221+
222+
- `sshd-session` (listener/monitor side) should not perform banner exchange that upstream moved to `sshd-auth`.
223+
- For Windows `FORK_NOT_SUPPORTED` post-auth child (`sshd-session -z`), monitor message order matters:
224+
- Receive identification-exchange state first.
225+
- Then receive authenticated user context.
226+
227+
If this ordering is wrong, common symptoms are:
228+
- pre-auth failures such as banner parsing or signature mismatches
229+
- post-auth `Invalid user` with empty username
230+
- monitor keystate errors like `incomplete message`
231+
218232
## Common Conflict Patterns
219233

220234
### File System Operations
221235
- **Fork/exec calls** → Use Windows process creation APIs
222236
- **Signal handling** → Use Windows event mechanisms
223237
- **File permissions** → Adapt to Windows ACL model
224238

239+
### Privsep and Monitor State Transitions (Windows)
240+
- For split `sshd-session` / `sshd-auth` flows, keep sender/receiver message ordering identical across monitor channels.
241+
- Do not add ad-hoc state shuttling unless both sender and receiver are updated in lockstep.
242+
- When debugging, verify the first protocol failure point (banner exchange vs KEX vs post-auth keystate) before changing multiple stages at once.
243+
225244
### Build System Changes
226245
- **Makefile additions** → Update Visual Studio project files (use `\r\n` line endings)
227246
- **New dependencies** → Check Windows compatibility

.github/instructions/testing.instructions.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ In this scenario, do not create a temporary local user and random password. Inst
107107
### Steps
108108
1. Open terminal A in the build output directory and run sshd in foreground debug mode:
109109
```pwsh
110-
cd .\contrib\win32\openssh\x64\Release
110+
cd .\bin\x64\Release
111111
.\sshd.exe -ddd
112112
```
113113

114114
2. Open terminal B and attempt local key-based connection:
115115
```pwsh
116-
ssh localhost
116+
.\ssh.exe localhost
117117
```
118118

119119
3. Confirm validation success by checking both sides:
@@ -124,6 +124,8 @@ ssh localhost
124124
- This mode is intended for machines that already have admin key-based auth configured.
125125
- Keep `sshd -ddd` running only for validation and stop it after the test.
126126
- Use this scenario instead of `Test-OpenSSHFunctionality` when declared in the prompt.
127+
- Use the rebuilt client and server from the same output directory (`.\bin\x64\Release`) to avoid version-mismatch handshake artifacts.
128+
- Do not run extra port probes (for example `Test-NetConnection localhost -Port 22`) between starting `sshd -ddd` and the first `ssh` attempt; probes can consume the one foreground debug session and produce misleading connection-reset/refused behavior.
127129

128130
## Manual Testing Procedures (For Troubleshooting Only)
129131

@@ -276,8 +278,8 @@ Get-NetFirewallRule | Where-Object {$_.DisplayName -like "*SSH*"}
276278
- **Parameters**: (use defaults)
277279

278280
If the prompt declares `Validation scenario=entra-id-debug-localhost`, use the Entra-ID debug localhost flow instead:
279-
- Run `.\sshd.exe -ddd` in one terminal
280-
- Run `ssh localhost` in another terminal
281+
- Run `.\sshd.exe -ddd` in one terminal from `.\bin\x64\Release`
282+
- Run `.\ssh.exe localhost` in another terminal from `.\bin\x64\Release`
281283
- Report outcome from both client connection behavior and server debug logs
282284

283285
2. **If test passes**, the merge is validated for basic SSH functionality

0 commit comments

Comments
 (0)