Add Honeysap compatibility#93
Conversation
|
@martingalloar this is the PR I mentioned ealier that builds the foundation for HoneySAP. If you do not find any issues we can merge this and start working on HoneySAP. thank you! |
| if name_min <= name_len <= name_max and name_end <= len(raw): | ||
| name = decode_value(raw[idx + 6:name_end]) | ||
| if name and _RFC_PARAM_NAME_RE.match(name): | ||
| val, _ = find_tlv_field_by_marker(raw, 0x0203, name_end) |
There was a problem hiding this comment.
Went through this one a few times and I'm not sure I fully get it without having more context on SAPNWRFC. This might be fine for now.
There was a problem hiding this comment.
I'm working on future improvements on this at the moment especially on getting a proper RFC implementation and parsing in place. But as I said, this will be a future PR. Right now, this was "just to get HoneySAP" working.
| if raw is None: | ||
| return None | ||
|
|
||
| if len(raw) >= 4 and raw[1:2] == b"\x00" and raw[3:4] == b"\x00": |
There was a problem hiding this comment.
The UTF-16LE detection here is fairly coarse. A non-ASCII UTF-16LE payload or a binary field with the same byte pattern can be decoded incorrectly. I'm not sure there's a more deterministic way to check for the right payload while doing the decoding.
|
Hi @martingalloar, @randomstr1ng, I picked up the review comment about missing roundtrip coverage for the encoding-aware branch in
Both pass locally on top of @randomstr1ng happy to open a small PR against your |
Hi @DaCodah - thank you for you suggestion. I think that would make perfect sense for this: #93 (comment) if you can open a PR that would be great, then we can keep this single PR - thank you! |
|
Done! PR is open here: randomstr1ng/pysap-dev# |
Add UTF-16LE roundtrip tests for StrFixedLenPaddedField
This PR add required function and modules to add full compatibility for the HoneySAP Python3 PR #11
In addtion, this PR expands the integration and support for the SAP RFC protocol.