Files
fleet/server
Rajendra kadam 182307ac3b Add unit tests for Windows MDM WSTEP CSR parser helpers (#45457)
Adds unit tests for previously-uncovered parser helpers in
`server/mdm/microsoft/wstep_csr.go`:

- `parseBase128Int` — single/multi-byte values, non-minimal encoding
(leading `0x80`), truncation, 5-byte cap, `MaxInt32` overflow
- `parseTagAndLength` — short/long-form length, indefinite-length
rejection, non-minimal length and tag, shift overflow
- `parseSANExtension` — DNS, email, URI, IPv4, IPv6, plus malformed IP
length and non-IA5 DNS
- `domainToReverseLabels` — trailing dots, empty middle labels, single
labels

ASN.1 fixtures are built with `cryptobyte.Builder` to match the source
file's existing toolchain — no new dependencies. Pure-Go tests, run in
the `fast` bundle without Docker.

**Related issue:** Refs #33373

# Checklist for submitter

- [x] Added/updated automated tests


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Added comprehensive test coverage for certificate Subject Alternative
Name (SAN) parsing: domain label reversal, base‑128 integer decoding
with error classification, ASN.1 tag/length validation and boundary
cases, end‑to‑end parsing of multiple SAN name types (DNS, email,
IPv4/IPv6, URI), and numerous malformed/input edge‑case checks.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/45457)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-14 13:43:57 -05:00
..
2026-04-23 12:43:23 -05:00
2026-05-08 11:17:40 -04:00
2026-05-11 08:46:02 -05:00