- Timestamp:
- 10/06/16 21:10:15 (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-analyze
r77 r115 44 44 parser.add_argument('-p', dest='output_lines', type=int, default=10, 45 45 help='Number of lines of input to display in decoded form.') 46 parser.add_argument('-C', action='store_const', const=True, default=False, 47 help='Use mono output for decoded highlights.') 46 48 parser.add_argument('-c', action='store_const', const=True, default=False, 47 help='Use color output for decoded highlights.')48 parser.add_argument('-c256', action='store_const', const=True, default= False,49 help='Use 256 color output for decoded highlights. ')49 help='Use 8 color output for decoded highlights.') 50 parser.add_argument('-c256', action='store_const', const=True, default=True, 51 help='Use 256 color output for decoded highlights. (default)') 50 52 options = parser.parse_args() 51 53 … … 66 68 return s 67 69 68 if options.c256: 69 fg = code%216+16 70 bg = (code^0xffffffff)%216+16 71 return "\x1b[0;38;05;%d;48;05;%dm%s\x1b[0m" % (fg,bg,s) 70 if options.C: 71 return "\x1b[7m%s\x1b[0m" % s 72 72 elif options.c: 73 73 fg = code%6+31 … … 75 75 return "\x1b[0;%d;%dm%s\x1b[0m" % (fg,bg,s) 76 76 else: 77 return "\x1b[7m%s\x1b[0m" % s 77 fg = code%216+16 78 bg = (code^0xffffffff)%216+16 79 return "\x1b[0;38;05;%d;48;05;%dm%s\x1b[0m" % (fg,bg,s) 78 80 79 81 -
trunk/lib/bletchley/ssltls.py
r110 r115 45 45 context = SSL.Context(method) 46 46 context.set_verify(SSL.VERIFY_NONE, (lambda a,b,c,d,e: True)) 47 47 48 if key and len(certChain) > 0: 48 49 context.use_privatekey(key) … … 54 55 55 56 56 def startSSLTLS(sock, mode='client', handshake=SSL.TLSv1_METHOD, key=None, certChain=[]): 57 conn = SSL.Connection(createContext(handshake, key=key, certChain=certChain), sock) 57 def startSSLTLS(sock, mode='client', handshake=SSL.TLSv1_METHOD, key=None, certChain=[], cipher_list=None): 58 ''' 59 cipher_list example: b'DH-DSS-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DH-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA256:DH-RSA-AES256-SHA256:DH-DSS-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DH-RSA-AES256-SHA:DH-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:DH-RSA-CAMELLIA256-SHA:DH-DSS-CAMELLIA256-SHA:ADH-AES256-GCM-SHA384:ADH-AES256-SHA256:ADH-AES256-SHA:ADH-CAMELLIA256-SHA:DH-DSS-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:DH-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-DSS-AES128-SHA256:DH-RSA-AES128-SHA256:DH-DSS-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DH-RSA-AES128-SHA:DH-DSS-AES128-SHA:DHE-RSA-SEED-SHA:DHE-DSS-SEED-SHA:DH-RSA-SEED-SHA:DH-DSS-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-DSS-CAMELLIA128-SHA:DH-RSA-CAMELLIA128-SHA:DH-DSS-CAMELLIA128-SHA:ADH-AES128-GCM-SHA256:ADH-AES128-SHA256:ADH-AES128-SHA:ADH-SEED-SHA:ADH-CAMELLIA128-SHA:ADH-RC4-MD5:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DH-RSA-DES-CBC3-SHA:DH-DSS-DES-CBC3-SHA:ADH-DES-CBC3-SHA' 60 ''' 61 62 context = createContext(handshake, key=key, certChain=certChain) 63 if cipher_list: 64 context.set_cipher_list(cipher_list) 65 #if not key and mode == 'server': 66 #context.set_options(OpenSSL.SSL.OP_SINGLE_DH_USE) 67 #context.set_options(OpenSSL.SSL.OP_EPHEMERAL_RSA) 68 69 conn = SSL.Connection(context, sock) 58 70 if mode == 'client': 59 71 conn.set_connect_state()
Note: See TracChangeset
for help on using the changeset viewer.