summaryrefslogtreecommitdiff
path: root/sid_test.ml
Commit message (Collapse)AuthorAgeFilesLines
* sid.ml: rectify string used to derive constantPhilipp Gesang2018-12-111-0/+4
| | | | | Ugh, experiments show that MS will parse arbitrarily short hex encoded IAs which in turn revealed miscalculation in our sloppy parsing mode.
* sid: sid_test: add conformance mode imitating MS APIPhilipp Gesang2018-11-291-2/+93
| | | | | | | | | | | | Add a conformance handler “Con_MS” to achieve a behavior that mimicks that of MS’s implementation bug-for-bug. Aspects of reading and formatting governd by the conformance: - Validation of ident auths, - validation of subauths, - validation of leading zeros in decimal numbers, - zero-padding of hex numbers.
* sid: functorize well-formedness checksPhilipp Gesang2018-11-081-8/+8
| | | | | | Offload the test for member count and size constraints of sas and ia, respectively, into a separate validation module. This is a preparatory step toward adding less rigid parsing modes.
* sid: sid_test: make subauthorities mandatoryPhilipp Gesang2018-11-071-7/+23
| | | | | | | | | | | | | | | | | Both the constructor “Sid.create” and the string format parser must reject inputs lacking a subauthorities array of at least size one. Since the array is no longer optional, reorder the the constructor arguments to match the data representation. It is still possible to create SIDs without subauthorities via the “Sid.create_unsafe” constructor. Also, the packet representation will happily accept them because their definition (as well as that that of the identical RPC version) does not specify a minimum count. This is all rather ambiguous and exacerbated by the fact that [MS-DTYP] happily specifies an invalid SID “S-1-5” as the “NT_AUTHORITY”. However, both the grammar and the Win API “ConvertStringSidToSidA()” function reject SA-less inputs as invalid, so we should too.
* sid: sid_test: handle large ias correctlyPhilipp Gesang2018-11-071-27/+125
| | | | | In string format, the “identifier authority” is quirky: from 1 << 32 on the spec requires that exactly 12 hex digits be printed.
* sid: sid_test: validate identifier authority on create()Philipp Gesang2018-11-061-2/+18
| | | | Reject ia’s greater than six bytes can encompass.
* add linking exception to licensePhilipp Gesang2018-11-031-0/+2
|
* sid_test: unit test string format version numbers some morePhilipp Gesang2018-10-301-2/+18
|
* sid_test: prefer Stdint module shorthandsPhilipp Gesang2018-10-301-12/+11
|
* sid: catch more boundary violationsPhilipp Gesang2018-10-301-0/+32
|
* sid: fix off by one parsing bugPhilipp Gesang2018-10-301-0/+5
| | | | | In the string representation, hyphen is always succeeded by a number so we need to terminate at input length minus one.
* sid: sid_test: move conversion functions to resultPhilipp Gesang2018-10-301-47/+34
| | | | | | Get rid of all “StringFmt” APIs involving exceptions. There is now only the “decode” function which returns a result type.
* sid_test: add unit tests for Sid.createPhilipp Gesang2018-10-301-0/+17
|
* sid: optionally handle big endian in packet format codecPhilipp Gesang2018-10-301-0/+57
| | | | | Oddly enough this only has an effect on the sub_auths since the 48 bits of “identifier authority” are always handled in big endian.
* sid: implement decoder for “packet representation”Philipp Gesang2018-10-281-4/+113
|
* sid_test: unit test packed representationPhilipp Gesang2018-10-281-2/+34
|
* sid: sid_test: add current state to repoPhilipp Gesang2018-10-281-0/+95