protobuf-go/reflect/protoregistry
Joe Tsai 15076350e8 reflect/protodesc: enforce strict validation
Hyrum's Law dictates that if we do not prevent naughty behavior,
people will rely on it. If we do not validate that the provided
file descriptor is correct today, it will be near impossible
to add proper validation checks later on.

The logic added validates that the provided file descriptor is
correct according to the same semantics as protoc,
which was reversed engineered to derive the set of rules implemented here.
The rules are unfortunately complicated because protobuf is a language
full of many non-orthogonal features. While our logic is complicated,
it is still 1/7th the size of the equivalent C++ code!

Change-Id: I6acc5dc3bd2e4c6bea6cd9e81214f8104402602a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/184837
Reviewed-by: Damien Neil <dneil@google.com>
2019-07-03 20:46:51 +00:00
..
testprotos cmd/protoc-gen-go: un-deprecate enum maps 2019-06-20 19:36:37 +00:00
registry_test.go reflect/protodesc: enforce strict validation 2019-07-03 20:46:51 +00:00
registry.go reflect/protoregistry: remove Files.Find{Enum,Message,Extension,Service}ByName 2019-06-24 23:47:12 +00:00