Generic codec class - #5006
Open
polybassa wants to merge 7 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5006 +/- ##
=======================================
Coverage 80.50% 80.51%
=======================================
Files 390 391 +1
Lines 96785 96741 -44
=======================================
- Hits 77920 77893 -27
+ Misses 18865 18848 -17
🚀 New features to boost your workflow:
|
Member
|
I think there are too much comments in this PR |
Contributor
Author
|
Removed comments |
added 7 commits
August 1, 2026 13:14
…lementations AI-Assisted: yes (GitHub CoPilot Auto)
…lementations AI-Assisted: yes (GitHub CoPilot Auto)
AI-Assisted: no
AI-Assisted: no
AI-Assisted: no
AI-Assisted: yes (Cursor AI)
AI-Assisted: yes (Cursor)
polybassa
force-pushed
the
generic_codec
branch
from
August 1, 2026 11:28
7875b2f to
9d49b4f
Compare
Contributor
Author
|
@gpotter2 Updated, please have a look. |
gpotter2
reviewed
Aug 6, 2026
Comment on lines
+295
to
+298
| _decoding_error_class = BER_Decoding_Error | ||
| _generic_error_classes = (BER_Decoding_Error, ASN1_Error) | ||
| _decoding_error_object_class = ASN1_DECODING_ERROR | ||
|
|
Member
There was a problem hiding this comment.
Same than the other PR: if possible, can we move all the codec-specific utils to the 'codec' parameter (ASN1_Codecs.BER) ? I feel like it was designed this way, and it would likely be prettier in the long run
gpotter2
reviewed
Aug 6, 2026
Comment on lines
+164
to
+167
| # Attributes consumed by GenericCodecObject.check_string and .dec | ||
| _decoding_error_class = CBOR_Codec_Decoding_Error | ||
| _generic_error_classes = (CBOR_Codec_Decoding_Error, CBOR_Error) # type: ignore | ||
| _decoding_error_object_class = CBOR_DECODING_ERROR |
gpotter2
reviewed
Aug 6, 2026
| @@ -0,0 +1,229 @@ | |||
| # SPDX-License-Identifier: GPL-2.0-only | |||
| # This file is part of Scapy | |||
| # See https://scapy.net/ for more information | |||
Member
There was a problem hiding this comment.
I think this might deserve to be in scapy/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces common classes for shared code between codecs like CBOR and ASN.1