repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
XX-Net | code/default/lib/noarch/pyasn1/__init__.py | .py | import sys
# https://www.python.org/dev/peps/pep-0396/
__version__ = '0.4.3'
if sys.version_info[:2] < (2, 4):
raise RuntimeError('PyASN1 requires Python 2.4 or later')
| 8 | 175 |
XX-Net | code/default/lib/noarch/pyasn1/debug.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import logging
from pyasn1 import __version__
from pyasn1 import error
from pyasn1.compat.octets import octs2ints
__all__ = ['Debug', 'setLogger', 'hexdump']
fl... | 146 | 3,367 |
XX-Net | code/default/lib/noarch/pyasn1/type/constraint.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# Original concept and code by Mike C. Fletcher.
#
import sys
from pyasn1.type import error
__all__ = ['SingleValueConstraint', 'ContainedSubtypeConstraint',
... | 557 | 16,040 |
XX-Net | code/default/lib/noarch/pyasn1/type/char.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
from pyasn1 import error
from pyasn1.type import tag
from pyasn1.type import univ
__all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61... | 322 | 10,759 |
XX-Net | code/default/lib/noarch/pyasn1/type/namedtype.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
from pyasn1 import error
from pyasn1.type import tag
from pyasn1.type import tagmap
__all__ = ['NamedType', 'OptionalNamedType', 'DefaultedNamedType',... | 560 | 16,447 |
XX-Net | code/default/lib/noarch/pyasn1/type/namedval.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# ASN.1 named integers
#
from pyasn1 import error
__all__ = ['NamedValues']
class NamedValues(object):
"""Create named values object.
The |NamedValues|... | 192 | 4,906 |
XX-Net | code/default/lib/noarch/pyasn1/type/useful.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import datetime
from pyasn1 import error
from pyasn1.compat import dateandtime
from pyasn1.compat import string
from pyasn1.type import char
from pyasn1.type impo... | 192 | 5,370 |
XX-Net | code/default/lib/noarch/pyasn1/type/univ.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import math
import sys
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat import binary
from pyasn1.compat import integer
from pyasn1.co... | 3,062 | 100,129 |
XX-Net | code/default/lib/noarch/pyasn1/type/opentype.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
__all__ = ['OpenType']
class OpenType(object):
"""Create ASN.1 type map indexed by a value
The *DefinedBy* object models the ASN.1 *DEFINED BY* clause ... | 76 | 1,799 |
XX-Net | code/default/lib/noarch/pyasn1/type/tagmap.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import error
__all__ = ['TagMap']
class TagMap(object):
"""Map *TagSet* objects to ASN.1 types
Create an object mapping *TagSet* object to ... | 97 | 3,015 |
XX-Net | code/default/lib/noarch/pyasn1/type/tag.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import error
__all__ = ['tagClassUniversal', 'tagClassApplication', 'tagClassContext',
'tagClassPrivate', 'tagFormatSimple', 'tagFormatCons... | 334 | 9,489 |
XX-Net | code/default/lib/noarch/pyasn1/type/base.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
from pyasn1 import error
from pyasn1.compat import calling
from pyasn1.type import constraint
from pyasn1.type import tag
from pyasn1.type import tagma... | 644 | 20,585 |
XX-Net | code/default/lib/noarch/pyasn1/codec/cer/encoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import error
from pyasn1.codec.ber import encoder
from pyasn1.compat.octets import str2octs, null
from pyasn1.type import univ
from pyasn1.type import ... | 297 | 8,878 |
XX-Net | code/default/lib/noarch/pyasn1/codec/cer/decoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import error
from pyasn1.codec.ber import decoder
from pyasn1.compat.octets import oct2int
from pyasn1.type import univ
__all__ = ['decode']
class B... | 115 | 3,725 |
XX-Net | code/default/lib/noarch/pyasn1/codec/ber/eoo.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1.type import base
from pyasn1.type import tag
__all__ = ['endOfOctets']
class EndOfOctets(base.AbstractSimpleAsn1Item):
defaultValue = 0
tagS... | 29 | 634 |
XX-Net | code/default/lib/noarch/pyasn1/codec/ber/encoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import debug
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat.integer import to_bytes
from pyasn1.compat.octets import (int... | 722 | 23,801 |
XX-Net | code/default/lib/noarch/pyasn1/codec/ber/decoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import debug
from pyasn1 import error
from pyasn1.codec.ber import eoo
from pyasn1.compat.integer import from_bytes
from pyasn1.compat.octets import oc... | 1,380 | 52,527 |
XX-Net | code/default/lib/noarch/pyasn1/codec/native/encoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from pyasn1 import debug
from pyasn1 import error
from pyasn1.type import... | 230 | 6,711 |
XX-Net | code/default/lib/noarch/pyasn1/codec/native/decoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import debug
from pyasn1 import error
from pyasn1.type import base
from pyasn1.type import char
from pyasn1.type import tag
from pyasn1.type import uni... | 215 | 7,754 |
XX-Net | code/default/lib/noarch/pyasn1/codec/der/encoder.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import error
from pyasn1.codec.cer import encoder
from pyasn1.type import univ
__all__ = ['encode']
class SetEncoder(encoder.SetEncoder):
@stati... | 108 | 3,085 |
XX-Net | code/default/lib/noarch/pyasn1/compat/dateandtime.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import time
from datetime import datetime
from sys import version_info
__all__ = ['strptime']
if version_info[:2] <= (2, 4):
def strptime(text, dateFormat)... | 23 | 482 |
XX-Net | code/default/lib/noarch/pyasn1/compat/binary.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from sys import version_info
if version_info[0:2] < (2, 6):
def bin(value):
bitstring = []
if value > 0:
prefix = '0b'
el... | 34 | 698 |
XX-Net | code/default/lib/noarch/pyasn1/compat/integer.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
try:
import platform
implementation = platform.python_implementation()
except (ImportError, AttributeError):
implementation = 'CPython'
... | 111 | 2,987 |
XX-Net | code/default/lib/noarch/pyasn1/compat/string.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from sys import version_info
if version_info[:2] <= (2, 5):
def partition(string, sep):
try:
a, c = string.split(sep, 1)
except ... | 27 | 505 |
XX-Net | code/default/lib/noarch/pyasn1/compat/octets.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from sys import version_info
if version_info[0] <= 2:
int2oct = chr
# noinspection PyPep8
ints2octs = lambda s: ''.join([int2oct(x) for x in s])
n... | 47 | 1,348 |
XX-Net | code/default/lib/noarch/pyasn1/compat/calling.py | .py | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from sys import version_info
__all__ = ['callable']
if (2, 7) < version_info[:2] < (3, 2):
import collections
def callable(x):
return isinstanc... | 21 | 379 |
XX-Net | code/default/lib/noarch/front_base/tlslite_wrap.py | .py |
# this wrap has a close callback.
# Which is used by ip manager
# ip manager keep a connection number counter for every ip.
# the wrap SSL implementation, python 2.7 will use pyOpenSSL, python 3.x will use build in ssl.
# This can also be used to store some attribute like ip_str/appid
import socket
from tlslite.t... | 185 | 5,345 |
XX-Net | code/default/lib/noarch/front_base/http1.py | .py | from queue import Queue
import threading
from .http_common import *
import simple_http_client
import utils
def pack_headers(headers):
out_list = []
for k, v in headers.items():
if isinstance(v, int):
out_list.append(b'%s: %d\r\n' % (utils.to_bytes(k), v))
else:
out_lis... | 307 | 11,161 |
XX-Net | code/default/lib/noarch/front_base/http_dispatcher.py | .py | #!/usr/bin/env python
# coding:utf-8
"""
This file manage the ssl connection dispatcher
Include http/1.1 and http/2 workers.
create ssl socket, then run worker on ssl.
if ssl suppport http/2, run http/2 worker.
provide simple https request block api.
caller don't need to known ip/ssl/http2/appid.
performance:
ge... | 597 | 20,703 |
XX-Net | code/default/lib/noarch/front_base/pyopenssl_wrap.py | .py |
# this wrap has a close callback.
# Which is used by ip manager
# ip manager keep a connection number counter for every ip.
# the wrap SSL implementation, python 2.7 will use pyOpenSSL, python 3.x will use build in ssl.
# This can also be used to store some attribute like ip_str/appid
import os
import sys
import d... | 537 | 18,490 |
XX-Net | code/default/lib/noarch/front_base/connect_manager.py | .py | #!/usr/bin/env python
# coding:utf-8
"""
This file manage the ssl connection pool.
For faster access the target host,
ssl link will save to pool after use.
and need keep alive every 60 seconds.
We create multi-thread to try-connect google cloud ip.
we also keep host connect for direct connect.
every ssl connect ca... | 410 | 14,867 |
XX-Net | code/default/lib/noarch/front_base/host_manager.py | .py | import random
class HostManagerBase(object):
def get_sni_host(self, ip):
return None, ""
| 7 | 103 |
XX-Net | code/default/lib/noarch/front_base/ssl_wrap.py | .py |
# this wrap has a close callback.
# Which is used by ip manager
# ip manager keep a connection number counter for every ip.
# the wrap SSL implementation, python 2.7 will use pyOpenSSL, python 3.x will use build in ssl.
# This can also be used to store some attribute like ip_str/appid
import os
import sys
import d... | 416 | 13,347 |
XX-Net | code/default/lib/noarch/front_base/random_get_slice.py | .py | import os
import random
import threading
class RandomGetSlice(object):
def __init__(self, fn, line_max_size=80, spliter='\n'):
self.fn = fn
self.line_max_size = line_max_size
self.spliter = spliter
self.lock = threading.Lock()
self.fd = open(fn, "r")
self.fsize = o... | 38 | 1,158 |
XX-Net | code/default/lib/noarch/front_base/http2_stream.py | .py | # -*- coding: utf-8 -*-
"""
port from hyper/http20/stream for async
remove push support
increase init window size to improve performance
~~~~~~~~~~~~~~~~~~~
Objects that make up the stream-level abstraction of hyper's HTTP/2 support.
Conceptually, a single HTTP/2 connection is made up of many streams: each
stream is... | 422 | 16,977 |
XX-Net | code/default/lib/noarch/front_base/domain_manager.py | .py |
class DomainManagerBase(object):
def get_host_sni(self):
return "", "" | 5 | 84 |
XX-Net | code/default/lib/noarch/front_base/check_ip.py | .py | import socket
import time
import hyper
import simple_http_client
import utils
class CheckIp(object):
def __init__(self, logger, config, connect_creator):
self.logger = logger
self.config = config
self.connect_creator = connect_creator
self.check_content = utils.to_bytes(self.confi... | 103 | 3,428 |
XX-Net | code/default/lib/noarch/front_base/http2_connection.py | .py | import time
from six.moves import queue
import threading
import socket
import errno
import struct
from ssl import SSLError
from .http_common import *
from hyper.common.bufsocket import BufferedSocket
from hyper.common.exceptions import ConnectionResetError
from hyper.packages.hyperframe.frame import (
FRAMES, ... | 521 | 20,437 |
XX-Net | code/default/lib/noarch/front_base/connect_creator.py | .py | import socket
import struct
import time
import sys
import socks
import utils
from . import openssl_wrap
from subj_alt_name import SubjectAltName
from pyasn1.codec.der import decoder as der_decoder
class ConnectCreator(object):
def __init__(self, logger, config, openssl_context=None, host_manager=None,
... | 244 | 10,327 |
XX-Net | code/default/lib/noarch/front_base/http_common.py | .py | import threading
import time
import random
from queue import Queue
import simple_http_client
import utils
class Task(object):
def __init__(self, logger, config, method, host, path, headers, body, queue, url, timeout):
self.logger = logger
self.config = config
self.method = method
... | 333 | 11,660 |
XX-Net | code/default/lib/noarch/front_base/config.py | .py |
import xconfig
class ConfigBase(xconfig.Config):
def set_default(self):
# proxy
self.set_var("PROXY_ENABLE", 0)
self.set_var("PROXY_TYPE", "HTTP")
self.set_var("PROXY_HOST", "")
self.set_var("PROXY_PORT", 0)
self.set_var("PROXY_USER", "")
self.set_var("PROX... | 119 | 4,971 |
XX-Net | code/default/lib/noarch/front_base/boringssl_wrap.py | .py | # this wrap has a close callback.
# Which is used by ip manager
# ip manager keep a connection number counter for every ip.
import socket
import threading
import selectors2 as selectors
import utils
from boringssl import lib as bssl, ffi
class SSLConnection(object):
BIO_CLOSE = 1
def __init__(self, cont... | 363 | 13,602 |
XX-Net | code/default/lib/noarch/front_base/openssl_wrap.py | .py |
# this wrap has a close callback.
# Which is used by ip manager
# ip manager keep a connection number counter for every ip.
# the wrap SSL implementation, python 2.7 will use pyOpenSSL, python 3.x will use build in ssl.
# This can also be used to store some attribute like ip_str/appid
import sys
error_str = ""
im... | 35 | 996 |
XX-Net | code/default/lib/noarch/front_base/ip_manager.py | .py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from six.moves import queue
import operator
import os
import threading
import time
import random
import six
import utils
class IpManagerBase():
def __init__(self, config, ip_source, logger, speed_fn=None):
self.scan_thread_lock = threading.Lock()... | 1,046 | 39,322 |
XX-Net | code/default/lib/noarch/front_base/ip_source.py | .py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import time
import os
import threading
import struct
import utils
from . import random_get_slice
random.seed(time.time()* 1000000)
class IpSimpleSource(object):
def __init__(self, ips=[]):
self.ips = ips
def set_ips(self, ips):
sel... | 226 | 7,158 |
XX-Net | code/default/lib/noarch/idna/idnadata.py | .py | # This file is automatically generated by build-idnadata.py
scripts = {
'Greek': (
(0x370, 0x374),
(0x375, 0x378),
(0x37a, 0x37e),
(0x384, 0x385),
(0x386, 0x387),
(0x388, 0x38b),
(0x38c, 0x38d),
(0x38e, 0x3a2),
(0x3a3, 0x3e2),
(0x3f0, ... | 1,585 | 35,172 |
XX-Net | code/default/lib/noarch/idna/uts46data.py | .py | # This file is automatically generated by tools/build-uts46data.py
# vim: set fileencoding=utf-8 :
"""IDNA Mapping Table from UTS46."""
uts46data = (
(0x0, '3'),
(0x1, '3'),
(0x2, '3'),
(0x3, '3'),
(0x4, '3'),
(0x5, '3'),
(0x6, '3'),
(0x7, '3'),
(0x8, '3'),
(0x9, '3'),
(0xA... | 7,268 | 175,774 |
XX-Net | code/default/lib/noarch/idna/compat.py | .py | from idna.core import *
from idna.codec import *
def ToASCII(label):
return encode(label)
def ToUnicode(label):
return decode(label)
def nameprep(s):
raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol")
| 13 | 240 |
XX-Net | code/default/lib/noarch/idna/intranges.py | .py | """
Given a list of integers, made up of (hopefully) a small number of long runs
of consecutive integers, compute a representation of the form
((start1, end1), (start2, end2) ...). Then answer the question "was x present
in the original list?" in time O(log(# runs)).
"""
import bisect
def intranges_from_list(list_):
... | 47 | 1,521 |
XX-Net | code/default/lib/noarch/idna/codec.py | .py | from idna.core import encode, decode, alabel, ulabel, IDNAError
import codecs
import re
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
class Codec(codecs.Codec):
def encode(self, data, errors='strict'):
if errors != 'strict':
raise IDNAError("Unsupported error handling \"{0}\"".... | 119 | 3,287 |
XX-Net | code/default/lib/noarch/idna/core.py | .py | from . import idnadata
import bisect
import unicodedata
import re
import sys
from .intranges import intranges_contain
_virama_combining_class = 9
_alabel_prefix = b'xn--'
_unicode_dots_re = re.compile('[\u002e\u3002\uff0e\uff61]')
if sys.version_info[0] == 3:
str = str
chr = chr
class IDNAError(UnicodeError)... | 388 | 11,332 |
XX-Net | code/default/lib/noarch/sortedcontainers/sortedlistwithkey.py | .py | # -*- coding: utf-8 -*-
#
# Sorted list implementation.
from sys import hexversion
from .sortedlist import recursive_repr
from bisect import bisect_left, bisect_right, insort
from itertools import chain, repeat, starmap
from collections import MutableSequence
from operator import iadd, add
from functools import wrap... | 1,330 | 41,067 |
XX-Net | code/default/lib/noarch/sortedcontainers/sorteddict.py | .py | # -*- coding: utf-8 -*-
#
# Sorted dict implementation.
from .sortedset import SortedSet
from .sortedlist import SortedList, recursive_repr
from .sortedlistwithkey import SortedListWithKey
from collections import Set, Sequence
from collections import KeysView as AbstractKeysView
from collections import ValuesView as A... | 796 | 26,718 |
XX-Net | code/default/lib/noarch/sortedcontainers/__init__.py | .py | # -*- coding: utf-8 -*-
"""
sortedcontainers Sorted Container Types Library
===============================================
SortedContainers is an Apache2 licensed containers library, written in
pure-Python, and fast as C-extensions.
Python's standard library is great until you need a sorted container type. Many
wil... | 56 | 1,676 |
XX-Net | code/default/lib/noarch/sortedcontainers/sortedlist.py | .py | # -*- coding: utf-8 -*-
#
# Sorted list implementation.
from sys import hexversion
from bisect import bisect_left, bisect_right, insort
from itertools import chain, repeat, starmap
from collections import MutableSequence
from operator import iadd, add
from functools import wraps
from math import log
if hexversion <... | 1,234 | 37,456 |
XX-Net | code/default/lib/noarch/sortedcontainers/sortedset.py | .py | # -*- coding: utf-8 -*-
#
# Sorted set implementation.
from .sortedlist import SortedList, recursive_repr
from .sortedlistwithkey import SortedListWithKey
from collections import Set, MutableSet, Sequence
from itertools import chain
import operator as op
class SortedSet(MutableSet, Sequence):
"""
A `SortedSet... | 295 | 9,403 |
XX-Net | code/default/lib/noarch/scrypto/table.py | .py | # !/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... | 180 | 8,539 |
XX-Net | code/default/lib/noarch/scrypto/rc4_md5.py | .py | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 64 | 2,016 |
XX-Net | code/default/lib/noarch/scrypto/m2.py | .py | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 117 | 3,314 |
XX-Net | code/default/lib/noarch/scrypto/ctypes_openssl.py | .py | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 188 | 5,880 |
XX-Net | code/default/lib/noarch/scrypto/util.py | .py | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 52 | 1,857 |
XX-Net | code/default/lib/noarch/scrypto/salsa20_ctr.py | .py | #!/usr/bin/env python
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | 140 | 4,124 |
XX-Net | code/default/lib/noarch/dnslib/server.py | .py | # -*- coding: utf-8 -*-
"""
DNS server framework - intended to simplify creation of custom resolvers.
Comprises the following components:
DNSServer - socketserver wrapper (in most cases you should just
need to pass this an appropriate resolver instance
an... | 351 | 13,262 |
XX-Net | code/default/lib/noarch/dnslib/label.py | .py | # -*- coding: utf-8 -*-
"""
DNSLabel/DNSBuffer - DNS label handling & encoding/decoding
"""
import fnmatch
from dnslib.bit import get_bits,set_bits
from dnslib.buffer import Buffer, BufferError
class DNSLabelError(Exception):
pass
class DNSLabel(object):
"""
Container for DNS label
Supports... | 293 | 8,346 |
XX-Net | code/default/lib/noarch/dnslib/intercept.py | .py | # -*- coding: utf-8 -*-
"""
InterceptResolver - proxy requests to upstream server
(optionally intercepting)
"""
import binascii,copy,socket,struct,sys
from dnslib import DNSRecord,RR,QTYPE,RCODE,parse_time
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
from dnslib... | 152 | 5,696 |
XX-Net | code/default/lib/noarch/dnslib/lex.py | .py | # -*- coding: utf-8 -*-
import collections,string
try:
from io import StringIO
except ImportError:
from io import StringIO
class Lexer(object):
"""
Simple Lexer base class. Provides basic lexer framework and
helper functionality (read/peek/pushback etc)
Each state is implement... | 357 | 10,239 |
XX-Net | code/default/lib/noarch/dnslib/__init__.py | .py | # -*- coding: utf-8 -*-
"""
dnslib
------
A library to encode/decode DNS wire-format packets supporting both
Python 2.7 and Python 3.2+.
The library provides:
* Support for encoding/decoding DNS packets between wire format,
python objects, and Zone/DiG textual representation (dnslib.dns)
* A server framework ... | 346 | 13,348 |
XX-Net | code/default/lib/noarch/dnslib/bit.py | .py | # -*- coding: utf-8 -*-
"""
Some basic bit mainpulation utilities
"""
FILTER = bytearray([ (i < 32 or i > 127) and 46 or i for i in range(256) ])
def hexdump(src, length=16, prefix=''):
"""
Print hexdump of string
>>> print(hexdump(b"abcd" * 4))
0000 61 62 63 64 61 62 63 64 61 62 63 64 61 62 ... | 90 | 2,419 |
XX-Net | code/default/lib/noarch/dnslib/ranges.py | .py | # -*- coding: utf-8 -*-
"""
Wrapper around property builtin to restrict attribute to defined
integer value range (throws ValueError).
Intended to ensure that values packed with struct are in the
correct range
>>> class T(object):
... a = range_property('a',-100,100)
... b = B('b')... | 94 | 2,421 |
XX-Net | code/default/lib/noarch/dnslib/buffer.py | .py | # -*- coding: utf-8 -*-
"""
Buffer - simple data buffer
"""
import binascii,struct
class BufferError(Exception):
pass
class Buffer(object):
"""
A simple data buffer - supports packing/unpacking in struct format
# Needed for Python 2/3 doctest compatibility
>>> def p(s):
... if not ... | 115 | 2,796 |
XX-Net | code/default/lib/noarch/dnslib/fixedresolver.py | .py | # -*- coding: utf-8 -*-
"""
FixedResolver - example resolver which responds with fixed response
to all requests
"""
import copy
from dnslib import RR
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
class FixedResolver(BaseResolver):
"""
Respond with fixed ... | 99 | 3,251 |
XX-Net | code/default/lib/noarch/dnslib/bimap.py | .py | # -*- coding: utf-8 -*-
"""
Bimap - bidirectional mapping between code/value
"""
class BimapError(Exception):
pass
class Bimap(object):
"""
Bi-directional mapping between code/value.
Initialised using:
name: Used for exceptions
dict: Dict mapping from value ... | 79 | 2,144 |
XX-Net | code/default/lib/noarch/dnslib/client.py | .py | # -*- coding: utf-8 -*-
"""
DNS Client - DiG-like CLI utility.
Mostly useful for testing. Can optionally compare results from two
nameservers (--diff) or compare results against DiG (--dig).
Usage: python -m dnslib.client [options|--help]
See --help for usage.
"""
try:
from subprocess imp... | 130 | 4,772 |
XX-Net | code/default/lib/noarch/dnslib/proxy.py | .py | # -*- coding: utf-8 -*-
import binascii,socket,struct
from dnslib import DNSRecord
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
class ProxyResolver(BaseResolver):
"""
Proxy resolver - passes all requests to upstream DNS server and
returns response
Note that the... | 148 | 5,327 |
XX-Net | code/default/lib/noarch/dnslib/zoneresolver.py | .py | # -*- coding: utf-8 -*-
import copy
from dnslib import RR,QTYPE,RCODE
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
class ZoneResolver(BaseResolver):
"""
Simple fixed zone file resolver.
"""
def __init__(self,zone,glob=False):
"""
Initialise resolver... | 119 | 4,374 |
XX-Net | code/default/lib/noarch/dnslib/shellresolver.py | .py | # -*- coding: utf-8 -*-
try:
from subprocess import getoutput
except ImportError:
from subprocess import getoutput
from dnslib import RR,QTYPE,RCODE,TXT,parse_time
from dnslib.label import DNSLabel
from dnslib.server import DNSServer,DNSHandler,BaseResolver,DNSLogger
class ShellResolver(BaseResolver):
... | 117 | 4,137 |
XX-Net | code/default/lib/noarch/dnslib/dns.py | .py | # -*- coding: utf-8 -*-
"""
DNS - main dnslib module
Contains core DNS packet handling code
"""
import sys
import base64,binascii,collections,copy,os.path,random,socket,\
string,struct,textwrap,time
from itertools import chain
try:
from itertools import zip_longest
except ImportError:
if sys... | 1,559 | 50,594 |
XX-Net | code/default/lib/noarch/asn1crypto/_teletex_codec.py | .py | # coding: utf-8
"""
Implementation of the teletex T.61 codec. Exports the following items:
- register()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
import codecs
class TeletexCodec(codecs.Codec):
def encode(self, input_, errors='strict'):
return codecs.char... | 332 | 5,053 |
XX-Net | code/default/lib/noarch/asn1crypto/parser.py | .py | # coding: utf-8
"""
Functions for parsing and dumping using the ASN.1 DER encoding. Exports the
following items:
- emit()
- parse()
- peek()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
import sys
... | 293 | 9,171 |
XX-Net | code/default/lib/noarch/asn1crypto/pem.py | .py | # coding: utf-8
"""
Encoding DER to PEM and decoding PEM to DER. Exports the following items:
- armor()
- detect()
- unarmor()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
import base64
import re
import sys
from ._errors import unwrap
from ._types import type_name as _... | 223 | 6,145 |
XX-Net | code/default/lib/noarch/asn1crypto/pkcs12.py | .py | # coding: utf-8
"""
ASN.1 type classes for PKCS#12 files. Exports the following items:
- CertBag()
- CrlBag()
- Pfx()
- SafeBag()
- SecretBag()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from .... | 194 | 4,566 |
XX-Net | code/default/lib/noarch/asn1crypto/pdf.py | .py | # coding: utf-8
"""
ASN.1 type classes for PDF signature structures. Adds extra oid mapping and
value parsing to asn1crypto.x509.Extension() and asn1crypto.xms.CMSAttribute().
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from .cms import CMSAttributeType, CMSAttribute
from .... | 85 | 2,250 |
XX-Net | code/default/lib/noarch/asn1crypto/algos.py | .py | # coding: utf-8
"""
ASN.1 type classes for various algorithms using in various aspects of public
key cryptography. Exports the following items:
- AlgorithmIdentifier()
- AnyAlgorithmIdentifier()
- DigestAlgorithm()
- DigestInfo()
- DSASignature()
- EncryptionAlgorithm()
- HmacAlgorithm()
- KdfAlgorithm()
- P... | 1,190 | 35,867 |
XX-Net | code/default/lib/noarch/asn1crypto/x509.py | .py | # coding: utf-8
"""
ASN.1 type classes for X.509 certificates. Exports the following items:
- Attributes()
- Certificate()
- Extensions()
- GeneralName()
- GeneralNames()
- Name()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, ab... | 3,037 | 93,778 |
XX-Net | code/default/lib/noarch/asn1crypto/tsp.py | .py | # coding: utf-8
"""
ASN.1 type classes for the time stamp protocol (TSP). Exports the following
items:
- TimeStampReq()
- TimeStampResp()
Also adds TimeStampedData() support to asn1crypto.cms.ContentInfo(),
TimeStampedData() and TSTInfo() support to
asn1crypto.cms.EncapsulatedContentInfo() and some oids and value ... | 311 | 7,825 |
XX-Net | code/default/lib/noarch/asn1crypto/crl.py | .py | # coding: utf-8
"""
ASN.1 type classes for certificate revocation lists (CRL). Exports the
following items:
- CertificateList()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
import hashlib
from .algo... | 537 | 16,104 |
XX-Net | code/default/lib/noarch/asn1crypto/cms.py | .py | # coding: utf-8
"""
ASN.1 type classes for cryptographic message syntax (CMS). Structures are also
compatible with PKCS#7. Exports the following items:
- AuthenticatedData()
- AuthEnvelopedData()
- CompressedData()
- ContentInfo()
- DigestedData()
- EncryptedData()
- EnvelopedData()
- SignedAndEnvelopedData()... | 1,004 | 27,776 |
XX-Net | code/default/lib/noarch/asn1crypto/util.py | .py | # coding: utf-8
"""
Miscellaneous data helpers, including functions for converting integers to and
from bytes and UTC timezone. Exports the following items:
- OrderedDict()
- int_from_bytes()
- int_to_bytes()
- timezone.utc
- utc_with_dst
- create_timezone()
- inet_ntop()
- inet_pton()
- uri_to_iri()
- iri_... | 879 | 21,873 |
XX-Net | code/default/lib/noarch/asn1crypto/_errors.py | .py | # coding: utf-8
"""
Exports the following items:
- unwrap()
- APIException()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
import re
import textwrap
class APIException(Exception):
"""
An exception indicating an API has been removed from asn1crypto
"""
pa... | 55 | 1,070 |
XX-Net | code/default/lib/noarch/asn1crypto/__init__.py | .py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from .version import __version__, __version_info__
__all__ = [
'__version__',
'__version_info__',
'load_order',
]
def load_order():
"""
Returns a list of the module and sub-module names for asn1cry... | 48 | 1,219 |
XX-Net | code/default/lib/noarch/asn1crypto/_inet.py | .py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import socket
import struct
from ._errors import unwrap
from ._types import byte_cls, bytes_to_list, str_cls, type_name
def inet_ntop(address_family, packed_ip):
"""
Windows compatibility shim for socket.inet_... | 171 | 4,661 |
XX-Net | code/default/lib/noarch/asn1crypto/keys.py | .py | # coding: utf-8
"""
ASN.1 type classes for public and private keys. Exports the following items:
- DSAPrivateKey()
- ECPrivateKey()
- EncryptedPrivateKeyInfo()
- PrivateKeyInfo()
- PublicKeyInfo()
- RSAPrivateKey()
- RSAPublicKey()
Other type classes are defined that help compose the types listed above.
"""
... | 1,302 | 37,863 |
XX-Net | code/default/lib/noarch/asn1crypto/ocsp.py | .py | # coding: utf-8
"""
ASN.1 type classes for the online certificate status protocol (OCSP). Exports
the following items:
- OCSPRequest()
- OCSPResponse()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
f... | 704 | 19,024 |
XX-Net | code/default/lib/noarch/asn1crypto/csr.py | .py | # coding: utf-8
"""
ASN.1 type classes for certificate signing requests (CSR). Exports the
following items:
- CertificationRequest()
Other type classes are defined that help compose the types listed above.
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from .algos import Si... | 134 | 3,542 |
XX-Net | code/default/lib/noarch/asn1crypto/version.py | .py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__version__ = '1.5.1'
__version_info__ = (1, 5, 1)
| 7 | 152 |
XX-Net | code/default/lib/noarch/asn1crypto/_iri.py | .py | # coding: utf-8
"""
Functions to convert unicode IRIs into ASCII byte string URIs and back. Exports
the following items:
- iri_to_uri()
- uri_to_iri()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from encodings import idna # noqa
import codecs
import re
import sys
from ... | 292 | 8,733 |
XX-Net | code/default/lib/noarch/asn1crypto/_types.py | .py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import inspect
import sys
if sys.version_info < (3,):
str_cls = unicode # noqa
byte_cls = str
int_types = (int, long) # noqa
def bytes_to_list(byte_string):
return [ord(b) for b in byte_strin... | 47 | 939 |
XX-Net | code/default/lib/noarch/asn1crypto/_int.py | .py | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
def fill_width(bytes_, width):
"""
Ensure a byte string representing a positive integer is a specific width
(in bytes)
:param bytes_:
The integer byte string
:param width:
The desir... | 23 | 494 |
XX-Net | code/default/lib/noarch/asn1crypto/_ordereddict.py | .py | # Copyright (c) 2009 Raymond Hettinger
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish,... | 136 | 4,533 |
XX-Net | code/default/lib/noarch/asn1crypto/core.py | .py | # coding: utf-8
"""
ASN.1 type classes for universal types. Exports the following items:
- load()
- Any()
- Asn1Value()
- BitString()
- BMPString()
- Boolean()
- CharacterString()
- Choice()
- EmbeddedPdv()
- Enumerated()
- GeneralizedTime()
- GeneralString()
- GraphicString()
- IA5String()
- InstanceO... | 5,677 | 170,716 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.