# Path: sslscan.py

# 
# Path: sslscan/kb.py
# class ResultGroup(BaseResult):
#     """Group results"""
# 
#     def __init__(self, **kwargs):
#         BaseResult.__init__(self, **kwargs)
#         self._items = []
# 
#     def __iter__(self):
#         return self._items.__iter__()
# 
#     def append(self, item):
#         self._items.append(item)
# 
#     def get_items(self):
#         return self._items
# 
# class ResultValue(BaseResult):
#     """A single result value"""
# 
#     def __init__(self, name=None, value=None, **kwargs):
#         BaseResult.__init__(self, **kwargs)
#         self.name = name
#         self.value = value


import binascii
import flextls
from datetime import datetime
from sslscan import modules
from sslscan.kb import ResultGroup, ResultValue
from sslscan.module.scan import BaseScan
from flextls.exception import NotEnoughData
from flextls.protocol.handshake import Handshake, ServerHello, ServerHelloDone
from flextls.protocol.handshake.extension import Extension, Heartbeat as HeartbeatExtension
from flextls.protocol.record import SSLv3Record
from flextls.protocol.heartbeat import Heartbeat
from flextls.protocol.alert import Alert

            try:
                tmp_data = conn.recv(4096)
            except:
                return heartbeat_supported

            data += tmp_data
            while True:
                try:
                    (record, data) = SSLv3Record.decode(
                        data,
                        payload_auto_decode=False
                    )
                except NotEnoughData:
                    break

                if record.content_type == record.get_payload_pattern(Heartbeat):
                    record_with_heartbeat = record

                elif isinstance(record.payload, Alert):
                    if record.payload.level == 2:
                        return heartbeat_supported

        return record_with_heartbeat

    def run(self):
        kb = self._scanner.get_knowledge_base()

        kb.set(
            "vulnerability.custom.heartbleed",

# Path: sslscan.py

# 
# Path: sslscan/kb.py
# class ResultGroup(BaseResult):
#     """Group results"""
# 
#     def __init__(self, **kwargs):
#         BaseResult.__init__(self, **kwargs)
#         self._items = []
# 
#     def __iter__(self):
#         return self._items.__iter__()
# 
#     def append(self, item):
#         self._items.append(item)
# 
#     def get_items(self):
#         return self._items
# 
# class ResultValue(BaseResult):
#     """A single result value"""
# 
#     def __init__(self, name=None, value=None, **kwargs):
#         BaseResult.__init__(self, **kwargs)
#         self.name = name
#         self.value = value


# Path: sslscan/module/scan/vuln_heartbleed.py
import binascii
import flextls
from datetime import datetime
from sslscan import modules
from sslscan.kb import ResultGroup, ResultValue
from sslscan.module.scan import BaseScan
from flextls.exception import NotEnoughData
from flextls.protocol.handshake import Handshake, ServerHello, ServerHelloDone
from flextls.protocol.handshake.extension import Extension, Heartbeat as HeartbeatExtension
from flextls.protocol.record import SSLv3Record
from flextls.protocol.heartbeat import Heartbeat
from flextls.protocol.alert import Alert


            try:
                tmp_data = conn.recv(4096)
            except:
                return heartbeat_supported

            data += tmp_data
            while True:
                try:
                    (record, data) = SSLv3Record.decode(
                        data,
                        payload_auto_decode=False
                    )
                except NotEnoughData:
                    break

                if record.content_type == record.get_payload_pattern(Heartbeat):
                    record_with_heartbeat = record

                elif isinstance(record.payload, Alert):
                    if record.payload.level == 2:
                        return heartbeat_supported

        return record_with_heartbeat

    def run(self):
        kb = self._scanner.get_knowledge_base()

        kb.set(
            "vulnerability.custom.heartbleed",

            ResultGroup(