gbmcweb: Extract parseBootReference helper from setBootOrder
Move the UEFI "Boot####" parsing out of setBootOrder into a reusable
parseBootReference() helper that returns the 16-bit boot index, or
std::nullopt if the reference is malformed or out of range. The helper logs
the specific failure reason.
No behavior change: BootOrder PATCH still returns propertyValueFormatError
for the same inputs. This prepares for the upcoming BootOptions POST handler,
which validates BootOptionReference with the same rule.
- Add unit tests for valid and invalid references, including uint16 overflow.
Google-Bug-Id:539554519
PiperOrigin-RevId: 994562675
Change-Id: I844eae9317c0799f453991b8c6c1fa94071c51c4
1 file changed