diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-08-26 22:00:50 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-08-26 22:00:50 +0200 |
commit | 9c6b3eb58a22817daa576063c3626d7a239e7093 (patch) | |
tree | ab50d2b745c975e5e539a1866e07a20fa15f2577 /libmproxy/contrib/tls/utils.py | |
parent | 2cfc1b1b4030838f6047f18f8014c91926b414d0 (diff) | |
download | mitmproxy-9c6b3eb58a22817daa576063c3626d7a239e7093.tar.gz mitmproxy-9c6b3eb58a22817daa576063c3626d7a239e7093.tar.bz2 mitmproxy-9c6b3eb58a22817daa576063c3626d7a239e7093.zip |
clean up clienthello parsing
Diffstat (limited to 'libmproxy/contrib/tls/utils.py')
-rw-r--r-- | libmproxy/contrib/tls/utils.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/libmproxy/contrib/tls/utils.py b/libmproxy/contrib/tls/utils.py index a971af49..4c917303 100644 --- a/libmproxy/contrib/tls/utils.py +++ b/libmproxy/contrib/tls/utils.py @@ -24,29 +24,3 @@ class _UBInt24(construct.Adapter): def UBInt24(name): # noqa return _UBInt24(construct.Bytes(name, 3)) - - -def LengthPrefixedArray(subcon, length_field=construct.UBInt8("length")): - """ - An array prefixed by a byte length field. - - In contrast to construct.macros.PrefixedArray, - the length field signifies the number of bytes, not the number of elements. - """ - subcon_with_pos = construct.Struct( - subcon.name, - construct.Embed(subcon), - construct.Anchor("__current_pos") - ) - - return construct.Embed( - construct.Struct( - "", - length_field, - construct.Anchor("__start_pos"), - construct.RepeatUntil( - lambda obj, ctx: obj.__current_pos == ctx.__start_pos + getattr(ctx, length_field.name), - subcon_with_pos - ), - ) - )
\ No newline at end of file |