<s> from ztag . transform import ZGrabTransform , ZMapTransformOutput <EOL> from ztag import protocols , errors <EOL> from ztag . transform import Transformable <EOL> from ztag . errors import IgnoreObject <EOL> class SSLv2Transform ( ZGrabTransform ) : <EOL> name = "<STR_LIT>" <EOL> port = None <EOL> protocol = { <EOL> protocols . HTTPS , <EOL> protocols . SMTP , <EOL> protocols . SMTPS , <EOL> protocols . IMAP , <EOL> protocols . IMAPS , <EOL> protocols . POP3 , <EOL> protocols . POP3S , <EOL> } <EOL> subprotocol = protocols . HTTPS . SSL_2 <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( SSLv2Transform , self ) . __init__ ( * args , ** kwargs ) <EOL> def _transform_object ( self , obj ) : <EOL> wrapped = Transformable ( obj [ '<STR_LIT:data>' ] ) <EOL> ciphers = wrapped [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . resolve ( ) <EOL> certificate = wrapped [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] . resolve ( ) <EOL> sslv2_support = bool ( wrapped [ '<STR_LIT>' ] [ '<STR_LIT>' ] . resolve ( ) ) <EOL> sslv2_export = bool ( wrapped [ '<STR_LIT>' ] [ '<STR_LIT>' ] . resolve ( ) ) <EOL> sslv2_extra_clear = bool ( wrapped [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> [ '<STR_LIT>' ] . resolve ( ) ) <EOL> out = { <EOL> '<STR_LIT>' : sslv2_support , <EOL> '<STR_LIT>' : sslv2_export , <EOL> '<STR_LIT>' : sslv2_extra_clear , <EOL> } <EOL> if ciphers is not None : <EOL> out [ '<STR_LIT>' ] = ciphers <EOL> if certificate is not None : <EOL> out [ '<STR_LIT>' ] = { <EOL> '<STR_LIT>' : certificate [ '<STR_LIT>' ] <EOL> } <EOL> certificates = [ certificate ] <EOL> else : <EOL> certificates = list ( ) <EOL> zout = ZMapTransformOutput ( ) <EOL> zout . transformed = out <EOL> zout . certificates = certificates <EOL> return zout </s>
