# 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
                label="Heartbleed(Vulnerability)"
            )
        )

        result_heartbeat = None
        for protocol_version in self._scanner.get_enabled_versions():
            if protocol_version != flextls.registry.version.SSLv2:
                cipher_suites = flextls.registry.tls.cipher_suites.get_ids()
                result_heartbeat = self._send_heartbeat(protocol_version)
                if result_heartbeat is not None:
                    break

        if result_heartbeat is None:
            return

        kb_supported = None
        kb_vulnerable = None
        if result_heartbeat is False:
            kb_supported = False
            kb_vulnerable = False
        elif result_heartbeat is True:
            kb_supported = True
            kb_vulnerable = False
        else:
            kb_supported = True
            kb_vulnerable = True

        #print(hb.payload.payload)
        kb.set(
            "vulnerability.custom.heartbleed.extension_present",

# 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

                label="Heartbleed(Vulnerability)"
            )
        )

        result_heartbeat = None
        for protocol_version in self._scanner.get_enabled_versions():
            if protocol_version != flextls.registry.version.SSLv2:
                cipher_suites = flextls.registry.tls.cipher_suites.get_ids()
                result_heartbeat = self._send_heartbeat(protocol_version)
                if result_heartbeat is not None:
                    break

        if result_heartbeat is None:
            return

        kb_supported = None
        kb_vulnerable = None
        if result_heartbeat is False:
            kb_supported = False
            kb_vulnerable = False
        elif result_heartbeat is True:
            kb_supported = True
            kb_vulnerable = False
        else:
            kb_supported = True
            kb_vulnerable = True

        #print(hb.payload.payload)
        kb.set(
            "vulnerability.custom.heartbleed.extension_present",

            ResultValue(