diff options
author | Dave Borowitz <dborowitz@google.com> | 2015-06-09 17:23:03 -0700 |
---|---|---|
committer | Dave Borowitz <dborowitz@google.com> | 2015-06-11 11:52:42 -0400 |
commit | a85e817dc29a1d6a96beeb92383aa265b0303415 (patch) | |
tree | 8475768f98414b5cbd3b0d97d5e8d17df6847ca1 /tools | |
parent | d43703624ce4ac3379a4632b3dbf1049cd96c918 (diff) | |
download | jgit-a85e817dc29a1d6a96beeb92383aa265b0303415.tar.gz jgit-a85e817dc29a1d6a96beeb92383aa265b0303415.zip |
Rewrite push certificate parsing
- Consistently return structured data, such as actual ReceiveCommands,
which is more useful for callers that are doing things other than
verifying the signature, e.g. recording the set of commands.
- Store the certificate version field, as this is required to be part
of the signed payload.
- Add a toText() method to recreate the actual payload for signature
verification. This requires keeping track of the un-chomped command
strings from the original protocol stream.
- Separate the parser from the certificate itself, so the actual
PushCertificate object can be immutable. Make a fair attempt at deep
immutability, but this is not possible with the current mutable
ReceiveCommand structure.
- Use more detailed error messages that don't involve NON-NLS strings.
- Document null return values more thoroughly. Instead of having the
undocumented behavior of throwing NPE from certain methods if they
are not first guarded by enabled(), eliminate enabled() and return
null from those methods.
- Add tests for parsing a push cert from a section of pkt-line stream
using a real live stream captured with Wireshark (which, it should
be noted, uncovered several simply incorrect statements in C git's
Documentation/technical/pack-protocol.txt).
This is a slightly breaking API change to classes that were
technically public and technically released in 4.0. However, it is
highly unlikely that people were actually depending on public
behavior, since there were no public methods to create
PushCertificates with anything other than null field values, or a
PushCertificateParser that did anything other than infinite loop or
throw exceptions when reading.
Change-Id: I5382193347a8eb1811032d9b32af9651871372d0
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions