Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
fac5abbd
Commit
fac5abbd
authored
9 years ago
by
mtu
Browse files
Options
Downloads
Patches
Plain Diff
Fix ASN1_enum_INTEGER representation
parent
dba026d6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/asn1fields.py
+5
-1
5 additions, 1 deletion
scapy/asn1fields.py
with
5 additions
and
1 deletion
scapy/asn1fields.py
+
5
−
1
View file @
fac5abbd
...
@@ -185,7 +185,7 @@ class ASN1F_enum_INTEGER(ASN1F_INTEGER):
...
@@ -185,7 +185,7 @@ class ASN1F_enum_INTEGER(ASN1F_INTEGER):
return
self
.
any2i_one
(
pkt
,
x
)
return
self
.
any2i_one
(
pkt
,
x
)
def
i2repr_one
(
self
,
pkt
,
x
):
def
i2repr_one
(
self
,
pkt
,
x
):
if
x
is
not
None
:
if
x
is
not
None
:
r
=
self
.
i2s
.
get
(
x
.
val
)
r
=
self
.
i2s
.
get
(
x
)
if
r
:
if
r
:
return
r
+
"
"
+
repr
(
x
)
return
r
+
"
"
+
repr
(
x
)
return
repr
(
x
)
return
repr
(
x
)
...
@@ -393,6 +393,10 @@ class ASN1F_optional(ASN1F_field):
...
@@ -393,6 +393,10 @@ class ASN1F_optional(ASN1F_field):
if
self
.
_field
.
is_empty
(
pkt
):
if
self
.
_field
.
is_empty
(
pkt
):
return
""
return
""
return
self
.
_field
.
build
(
pkt
)
return
self
.
_field
.
build
(
pkt
)
def
any2i
(
self
,
pkt
,
x
):
return
self
.
_field
.
any2i
(
pkt
,
x
)
def
i2repr
(
self
,
pkt
,
x
):
return
self
.
_field
.
i2repr
(
pkt
,
x
)
class
ASN1F_CHOICE
(
ASN1F_field
):
class
ASN1F_CHOICE
(
ASN1F_field
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment