Mercurial > p > roundup > code
comparison roundup/scripts/roundup_server.py @ 5386:fc97f1f4a7e3
Python 3 preparation: use sys.maxsize instead of sys.maxint.
Tool-generated patch.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 22:20:20 +0000 |
| parents | 0942fe89e82e |
| children | 23b8e6067f7c |
comparison
equal
deleted
inserted
replaced
| 5385:e9fb7c539a52 | 5386:fc97f1f4a7e3 |
|---|---|
| 91 print(_('WARNING: generating temporary SSL certificate')) | 91 print(_('WARNING: generating temporary SSL certificate')) |
| 92 import OpenSSL, random | 92 import OpenSSL, random |
| 93 pkey = OpenSSL.crypto.PKey() | 93 pkey = OpenSSL.crypto.PKey() |
| 94 pkey.generate_key(OpenSSL.crypto.TYPE_RSA, 768) | 94 pkey.generate_key(OpenSSL.crypto.TYPE_RSA, 768) |
| 95 cert = OpenSSL.crypto.X509() | 95 cert = OpenSSL.crypto.X509() |
| 96 cert.set_serial_number(random.randint(0, sys.maxint)) | 96 cert.set_serial_number(random.randint(0, sys.maxsize)) |
| 97 cert.gmtime_adj_notBefore(0) | 97 cert.gmtime_adj_notBefore(0) |
| 98 cert.gmtime_adj_notAfter(60 * 60 * 24 * 365) # one year | 98 cert.gmtime_adj_notAfter(60 * 60 * 24 * 365) # one year |
| 99 cert.get_subject().CN = '*' | 99 cert.get_subject().CN = '*' |
| 100 cert.get_subject().O = 'Roundup Dummy Certificate' | 100 cert.get_subject().O = 'Roundup Dummy Certificate' |
| 101 cert.get_issuer().CN = 'Roundup Dummy Certificate Authority' | 101 cert.get_issuer().CN = 'Roundup Dummy Certificate Authority' |
