Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python2 compatibility issue with X509 DER parsing #117

Open
wants to merge 696 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
696 commits
Select commit Hold shift + click to select a range
c820e49
increase timeouts for test connections
tomato42 Nov 8, 2016
0ff8d46
Merge pull request #147 from tomato42/longer-timeouts
tomato42 Nov 8, 2016
aa2c0ef
Merge pull request #144 from tomato42/strong-pseudoprimes
tomato42 Nov 8, 2016
6fea5df
Merge pull request #139 from tomato42/dhe-small-subgroup
tomato42 Nov 8, 2016
9873105
method for finding first matching element
tomato42 Nov 8, 2016
669b2bf
wrap the ugly next() construct to get first matching element
tomato42 Nov 8, 2016
17ec70a
verify signatures created in cert verify
tomato42 Oct 27, 2016
9bbf2db
less code duplication in keyexchange
tomato42 Oct 27, 2016
3859eea
fix formatting of goodGroupParameters initializer
tomato42 Oct 27, 2016
9db7c07
cleanup comment
tomato42 Oct 27, 2016
ddfccf7
method to provide security estimate for DH and RSA keys
tomato42 Oct 27, 2016
7bb5a65
move divceil to utils module
tomato42 Oct 27, 2016
e9b899c
keyExchange with customizable DH parameters
tomato42 Nov 8, 2016
c034161
add dhParams to handshake settings
tomato42 Oct 27, 2016
52b6279
parsing OpenSSL dhparam output file
tomato42 Nov 2, 2016
bde265b
support loading DH params from file in tls.py
tomato42 Nov 3, 2016
f3ca624
add groups from RFC 7919
tomato42 Nov 3, 2016
93e336b
support for ffdhe in keyexchange
tomato42 Nov 3, 2016
c493b2e
add ffdhe groups in handshakesettings
tomato42 Nov 3, 2016
c3e3824
server side of FFDHE negotiation (RFC7919)
tomato42 Nov 3, 2016
00b30f4
add ffdhe support to client side
tomato42 Nov 3, 2016
0c3c575
correct alert for no shared ffdhe groups
tomato42 Nov 8, 2016
4811c93
Merge pull request #125 from tomato42/aes-init-speedup
tomato42 Nov 10, 2016
b4baebf
Merge pull request #141 from tomato42/parser-fixes
tomato42 Nov 10, 2016
a7d3128
fix docstring typo
tomato42 Nov 11, 2016
31fe6a5
Merge pull request #124 from tomato42/codec-speedup
tomato42 Nov 11, 2016
d69c210
mark as 0.7.0-alpha2
tomato42 Nov 18, 2016
f24b10a
Merge pull request #146 from tomato42/ffdhe
tomato42 Nov 25, 2016
f27245c
post-merge README update
tomato42 Nov 25, 2016
6cc5905
fix DHE interoperability issue with NSS
tomato42 Jan 4, 2017
cc2fa12
send correct alerts in case the ALPN ext is malformed
tomato42 Jan 25, 2017
73f615e
release 0.7.0-alpha3
tomato42 Jan 25, 2017
26a323a
Merge pull request #149 from tomato42/ske-hash-bug
tomato42 Jan 28, 2017
34f3bc9
add a big composite number to test the non-working of M-R primality test
tomato42 Apr 19, 2017
5a23c98
remove correct file on Windows
tomato42 Apr 24, 2017
6dca386
move the file database test before the memory test for SRP
tomato42 Apr 26, 2017
48e6e92
Merge pull request #164 from tomato42/windows-fixes
tomato42 Apr 27, 2017
dabab44
send valid hostname in padding check
tomato42 Jan 25, 2017
1bc2b16
add checks for names received in SNI ext
tomato42 May 4, 2017
ed25b26
add support for checking sent SNI
tomato42 May 4, 2017
0f81b56
add docs for anon and host in clienthelper
tomato42 May 4, 2017
b737a26
Merge pull request #148 from tomato42/sni-checks
tomato42 May 5, 2017
e533af1
explain why the check is duplicate in tlsconnection
tomato42 May 5, 2017
2ab01ee
Merge pull request #165 from tomato42/add-comment
tomato42 May 5, 2017
032942c
Merge pull request #150 from tomato42/alpn-fixes
tomato42 May 5, 2017
174a9d6
post-merge changelog update
tomato42 May 5, 2017
90412a8
Merge pull request #166 from tomato42/changelog-update
tomato42 May 5, 2017
fd670e3
release 0.7.0-alpha4
tomato42 May 5, 2017
c5d0b9a
add python 3.6 to .travis.yml
morrme May 7, 2017
c03c7b9
Update .travis.yml
morrme May 7, 2017
cc1a624
Merge pull request #167 from morrme/patch-1
tomato42 May 9, 2017
15daa20
save state of Extended Master Secret for resumption
tomato42 Mar 7, 2017
110f5de
don't resume without EMS if new connection asks for it
tomato42 Mar 7, 2017
bc763ce
fix EMS with client certificates
tomato42 Apr 5, 2017
951426a
Merge pull request #161 from tomato42/carmichael-numbers
tomato42 Jun 30, 2017
47cf45f
Merge pull request #160 from tomato42/ems-fixup
tomato42 Jun 30, 2017
7a029b6
update README after EMS fixes
tomato42 Jun 30, 2017
b313041
add Python 3.6 to setup.py
tomato42 Jun 30, 2017
cbf4ac9
0.7.0-alpha5 release
tomato42 Jun 30, 2017
f9a5d40
more usable API for RSA
tomato42 Mar 2, 2017
07d02af
change the RSA-PSS methods to accept hash not message
tomato42 Mar 8, 2017
3a24cfb
use hashAndSign and hashAndVerify in ServerKeyExchange
tomato42 Mar 2, 2017
48d4dd9
add SignatureScheme to constants
tomato42 Mar 2, 2017
ea1e5be
more test coverage for keyexchange
tomato42 Mar 2, 2017
7e85228
Support rsa-pss in ServerKeyExchange
tomato42 Jul 11, 2017
e8caddb
switch back to sign() and verify() for SKE
tomato42 Mar 2, 2017
c8f67d9
test case with md5 sig over CertificateVerify
tomato42 Mar 2, 2017
dbf92b0
add support of RSA-PSS to CertificateVerify
tomato42 Mar 2, 2017
5ba0bbe
add support for RSA-PSS on TLS client side
tomato42 Mar 8, 2017
87eb498
allow server to select RSA-PSS in SKE
tomato42 Jul 11, 2017
616a067
test with certificates signed with RSA-PSS
tomato42 Mar 8, 2017
4f7f0cc
support for rsassa-pss certificates and keys
tomato42 Mar 8, 2017
4e6e348
test with RSA-PSS certificates
tomato42 Mar 8, 2017
bf01e05
support rsa-pss in tls.py script
tomato42 Mar 8, 2017
b511fc1
do not use pkcs#1 scheme with rsa-pss certificates
tomato42 Mar 8, 2017
e3b2b5d
fix off by one error in RSA-PSS verify
tomato42 Mar 9, 2017
7a13e41
parse rsa-pss parameters with restrictions
tomato42 Mar 13, 2017
88e3516
reject non-empty EMS extension
tomato42 Jul 13, 2017
9dd6c24
negotiate ECDHE even if no curves advertised by client, assume prime2…
tomato42 Jul 13, 2017
4fbc442
fix typo in message
tomato42 Jul 13, 2017
ea11353
Merge pull request #168 from tomato42/ems-ext-validation
tomato42 Jul 13, 2017
47deeb1
Merge PR#158
tomato42 Jul 13, 2017
31c7ee1
release v0.7.0-alpha6
tomato42 Jul 13, 2017
8b2aca2
make ECDHE and FFDHE ciphersuite enabling more logical
tomato42 Jul 14, 2017
059328e
correctly handle errors from RSA_PSS verification
tomato42 Jul 14, 2017
d460fd9
Merge pull request #169 from tomato42/rsa-pss-fixup
tomato42 Jul 14, 2017
2144f74
Merge pull request #170 from tomato42/simplify-curve-negotiation
tomato42 Jul 14, 2017
f450a90
release v0.7.0-alpha7
tomato42 Jul 14, 2017
87527ed
reorder ciphers according to cipher ID
tomato42 Jan 26, 2017
594ad42
add TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
tomato42 Jan 26, 2017
b8aa961
add TLS_ECDHE_RSA_WITH_RC4_128_SHA
tomato42 Jan 26, 2017
a96cd3d
add ECDSA, ECDH/ECDSA and ECDH/RSA ciphers
tomato42 Feb 15, 2017
ec62f3c
reject SNI ext with trailing data
tomato42 Jul 18, 2017
5d322ee
reject malformed SNI extensions (no entries, empty entries)
tomato42 Jul 18, 2017
752cecd
reject empty supported_groups extension as invalid
tomato42 Jul 19, 2017
1291636
default to a common curve if no curves advertised
tomato42 Jul 19, 2017
9eadd6c
Merge pull request #153 from tomato42/default-curve
tomato42 Jul 19, 2017
f9ab959
test coverage for bytesToNumber
tomato42 Feb 7, 2016
1a84738
clean up the bytesToNumber implementation
tomato42 Feb 7, 2016
b3333dd
add support for little endian int to bytes conversion
tomato42 Feb 7, 2016
9322380
more test coverage for numerToByteArray
tomato42 Feb 7, 2016
b9160ea
cleanup numberToByteArray
tomato42 Feb 7, 2016
a2b8310
add little endian support to numberToByteArray
tomato42 Feb 7, 2016
18160a2
make the bytesToNumber much faster
tomato42 Feb 17, 2017
20eb024
add X25519 and X448 functions from RFC 7748
tomato42 Feb 17, 2017
73b857c
test cases for ECDH with X25519 methods
tomato42 Feb 23, 2017
d119f9a
add support for X25519 and X448 in TLS
tomato42 Jul 18, 2017
3373462
uncommon cases for x25519 and x448
tomato42 Feb 24, 2017
23bf57e
error checking on TLS level (from draft-ietf-tls-rfc4492bis)
tomato42 Jul 18, 2017
1b9f7d3
Merge pull request #151 from tomato42/ecdsa-ciphers
tomato42 Jul 19, 2017
4646646
release 0.7.0-alpha8
tomato42 Jul 19, 2017
d008300
Merge pull request #171 from tomato42/sni-fixes
tomato42 Jul 20, 2017
e0f1a75
release 0.7.0-alpha9
tomato42 Jul 20, 2017
3ae0ab9
improve readability of big endian variant of numberToByteArray
tomato42 Jul 21, 2017
3ed639b
update docs of numberToByteArray to indicate support for little endian
tomato42 Jul 21, 2017
44b8682
make the name of X25519_ORDER reflect contents
tomato42 Jul 21, 2017
7e29878
Merge pull request #154 from tomato42/rfc7748
tomato42 Jul 21, 2017
0b6e2a0
sphinx settings
tomato42 Jul 20, 2017
92271de
convert the documentation to sphinx format
tomato42 Jul 21, 2017
fdc45b3
Merge pull request #172 from tomato42/sphinx-docs
tomato42 Jul 24, 2017
48e839b
package building with Sphinx docs
tomato42 Jul 24, 2017
c414494
update acknowledgements
tomato42 Jul 24, 2017
6e9855d
release v0.7.0-beta1
tomato42 Jul 24, 2017
5dffb87
add repr() support to SignatureAlgorithmsExtension
tomato42 Jul 26, 2017
48983fd
test for regression introduced by 18160a23de04
tomato42 Jul 31, 2017
8e0ee72
fix regression introduced in 18160a23de04
tomato42 Jul 31, 2017
39de257
Merge pull request #175 from tomato42/ffdhe-null-params
tomato42 Jul 31, 2017
d9869e6
correctly handle missing ecdh key share from CKE message
tomato42 Jul 31, 2017
de94bf9
Merge pull request #173 from tomato42/x25519-fixup
tomato42 Jul 31, 2017
663364b
Release 0.7.0
tomato42 Jul 31, 2017
4d60332
fix long for pycrypto
tomato42 Aug 1, 2017
38f8feb
Merge pull request #177 from tomato42/pycrypto-ops
tomato42 Aug 1, 2017
ec48dab
Merge pull request #152 from tomato42/sigalg-repr
tomato42 Aug 1, 2017
d70409e
add test coverage for Certificate message
tomato42 Aug 2, 2017
5060d46
test coverage for Finished
tomato42 Aug 2, 2017
eb0794f
add test coverage for addExtension of HelloMessage
tomato42 Aug 8, 2017
e3c34c8
make the sslv2 client hello test case names unique
tomato42 Aug 8, 2017
4f6fca8
show that re-setting certificate_type in ServerHello to 0 works incor…
tomato42 Aug 8, 2017
c6ebf6f
fix handling of the certificate_type set to 0
tomato42 Aug 8, 2017
a8f4283
more test coverage for certificate_type
tomato42 Aug 8, 2017
a7addb4
test case for ServerHello without extensions list
tomato42 Aug 8, 2017
1300e9d
test ServerKeyExchange with rsa_pss signature
tomato42 Aug 8, 2017
f024371
test coverage for ServerHelloDone
tomato42 Aug 8, 2017
854b56c
test coverage for ServerHello next_protos
tomato42 Aug 8, 2017
94c3172
fix re-setting next_protos to None
tomato42 Aug 8, 2017
f31d324
coverage for ServerHello.__str__ with extensions
tomato42 Aug 8, 2017
5817571
test coverage for ChangeCipherSpec
tomato42 Aug 8, 2017
4dc70fb
test coverage for NextProtocol message
tomato42 Aug 8, 2017
10dec13
test coverage for ApplicationData
tomato42 Aug 8, 2017
a0979f5
exclude XXX from fixme checks
tomato42 Aug 8, 2017
c3a58b9
remove code duplication in ServerHello
tomato42 Aug 14, 2017
40f72e6
Merge pull request #178 from tomato42/certificate-test-coverage
tomato42 Aug 15, 2017
62d766e
increase the minimal mass for code to be duplicate
tomato42 Aug 11, 2017
7ad1291
Merge pull request #179 from tomato42/branch-coverage
tomato42 Aug 17, 2017
231eed2
add TLS 1.3 specific ciphers
tomato42 Aug 16, 2017
73108df
Supported Versions extension from TLS 1.3
tomato42 Aug 9, 2017
8a79706
introduce abstract type for extensions that are a list of tuples
tomato42 Aug 9, 2017
c44c230
make Signature Algorithms and Supported Versions share code
tomato42 Jul 27, 2017
3104c0e
Client side Key Share extension
tomato42 Jul 27, 2017
00feb45
server side Key Share extension
tomato42 Aug 9, 2017
cb518de
allow for encrypted extensions type
tomato42 Aug 18, 2017
5d6bc8f
parsing and writing TLS 1.3 Server Hello
tomato42 Jul 27, 2017
66943a6
Encrypted Extensions message
tomato42 Aug 9, 2017
3ebc62b
TLS 1.3 support for Finished
tomato42 Jul 27, 2017
67a2ff2
TLS 1.3 specific alert descriptions
tomato42 Aug 9, 2017
f7916e5
handling of Certificate message-specific extensions
tomato42 Aug 2, 2017
8113f32
TLS1.3 Certificate handshake message
tomato42 Aug 11, 2017
fd7bc2d
__repr__ for Certificate
tomato42 Aug 10, 2017
f562642
status_request Certificate extension
tomato42 Aug 10, 2017
a73bf06
early_data extension codepoint
tomato42 Aug 10, 2017
d9957a7
TLS 1.3 session ticket
tomato42 Aug 10, 2017
fdf26f7
HRR Key Share extension
tomato42 Aug 23, 2017
770a650
TLS 1.3 Hello Retry Request message
tomato42 Aug 11, 2017
8f8c4c3
add convenience functions to messages with extensions
tomato42 Aug 16, 2017
33821da
try to diagnose spurious ValueError raised by pycrypto
tomato42 Aug 23, 2017
3a2197a
Merge pull request #181 from tomato42/pycrypto-valueerror-debug
tomato42 Aug 24, 2017
ddaf97b
release 0.8.0-alpha1
tomato42 Aug 24, 2017
ed14cec
Merge pull request #180 from tomato42/tls-1.3-messages
nmav Aug 24, 2017
7d7095b
Jython2.7 bytearray bug fix.
fgoldefu May 17, 2016
3cc2160
Merge pull request #182 from tomato42/jython
tomato42 Aug 24, 2017
258d5a0
Improvements on precision of Throughput
ioef Aug 26, 2017
0b79402
Improvements on precision of Throughput Measuring Mechanism
ioef Aug 28, 2017
f296aeb
Merge pull request #183 from ioef/patch-5
tomato42 Aug 29, 2017
425be77
Initialise CRT values when not all provided
tomato42 Aug 28, 2017
eb3825a
return self in EncryptedExtensions.create()
tomato42 Aug 29, 2017
e614813
init Certificate for TLS1.3 even if create got X509CertChain
tomato42 Aug 29, 2017
945182a
remove QuantifiedCode badge
tomato42 Aug 31, 2017
48d7e3b
remove deprecated options from pylint config
tomato42 Aug 31, 2017
dc11f60
Merge pull request #184 from tomato42/pycrypto-issues
ep69 Sep 1, 2017
0a875c8
Merge pull request #186 from tomato42/pylint-deprecation
tomato42 Sep 1, 2017
960bb02
Merge pull request #185 from tomato42/messages-fixups
tomato42 Sep 1, 2017
cb41be0
standalone FFDHE key exchange
tomato42 Aug 11, 2017
3ad32c8
standalone ECDHE key exchange
tomato42 Aug 11, 2017
5c687b4
TLS 1.3 KDF
tomato42 Sep 4, 2017
c9676c3
constant for the tls1.3 draft protocol version
tomato42 Sep 4, 2017
24e5cae
TLS 1.3 handshake key derivation vector tests
tomato42 Sep 4, 2017
31d51b4
supported versions and TLS 1.3 handling in handshakesettings
tomato42 Sep 4, 2017
ed77633
exception for handling unexpected messages
tomato42 Aug 9, 2017
ab1cd85
TLS 1.3 record layer
tomato42 Sep 4, 2017
21dd522
Merge pull request #187 from tomato42/tls-1.3-record-layer
tomato42 Sep 4, 2017
eddc929
Merge pull request #188 from tomato42/kex-changes
tomato42 Sep 5, 2017
4c3be0d
human-readable list listing
tomato42 Aug 16, 2017
befda47
Human readable handshake type on unexpected message
tomato42 Aug 16, 2017
85c999b
add cookie extension id
tomato42 Aug 16, 2017
0864d92
add message_hash handshake type
tomato42 Aug 16, 2017
2b9e2a1
allow comparing handshake messages
tomato42 Sep 5, 2017
ad72fc5
Merge pull request #192 from tomato42/constants-tls13
tomato42 Sep 6, 2017
08e59d1
TLS1.3 changes to FFDH
tomato42 Sep 6, 2017
9a6bf59
Merge pull request #190 from tomato42/unexpected_handshake_error
ep69 Sep 6, 2017
82d32e7
Merge pull request #193 from tomato42/tls-13-ffdh
tomato42 Sep 6, 2017
3e8aaa2
Merge pull request #191 from tomato42/handshake_eq
tomato42 Sep 6, 2017
5e63643
restore API compatibility for RecordLayer
tomato42 Nov 1, 2017
874c4df
Merge pull request #197 from tomato42/tls13-bustage-fix
tomato42 Nov 6, 2017
92c876c
disable Nagle algorithm in example script
tomato42 Dec 1, 2017
79eee61
Merge pull request #199 from tomato42/nagle
tomato42 Dec 4, 2017
f7c12ff
make setting the encryptThenMAC apply since next cipher change
tomato42 Jan 18, 2018
9802400
Merge pull request #201 from tomato42/etm-fixes
tomato42 Feb 5, 2018
6e5eb0f
depend on isort that works on Py2.6
tomato42 Feb 5, 2018
3a77186
workaround limitations of distutils on Py3.3
tomato42 Feb 5, 2018
73df547
Merge pull request #203 from tomato42/2.6-compat
tomato42 Feb 5, 2018
510e683
run CI on old stable branches
tomato42 Feb 9, 2018
e4ca2d3
add support for m2crypto in python3
tomato42 Feb 9, 2018
a152c26
also test with m2crypto on py3
tomato42 Feb 9, 2018
06bb34f
Merge pull request #204 from tomato42/py3-m2crypto
tomato42 Feb 9, 2018
b2e3b89
increase timeouts for iteraction
tomato42 Feb 21, 2018
5deb128
TLS 1.3 padding support
ep69 Feb 22, 2018
3e0b221
Merge pull request #217 from ep69/tls-1.3-padding
tomato42 Feb 23, 2018
8077633
Merge pull request #215 from tomato42/more-time
tomato42 Feb 23, 2018
042c729
decorator for deprecating method parameter names
tomato42 Feb 22, 2018
0efc3fc
deprecating class fields and methods
tomato42 Feb 22, 2018
34e74cc
update pylintrc - forbid camelCase names
tomato42 Feb 23, 2018
9c48f12
add deprecations module to docs
tomato42 Feb 23, 2018
1e4c092
fix names in tlslite.defragmenter
tomato42 Feb 23, 2018
9d23e4b
handling of Encrypted Extensions in record layer
tomato42 Aug 9, 2017
85686eb
handling of TLS 1.3 Certificate and Finished in record layer
tomato42 Aug 3, 2017
4cc7620
unittest based integration test - connection
tomato42 Aug 10, 2017
1ddee5c
handling of New Session Ticket in tls record layer
tomato42 Aug 10, 2017
ee67802
key shares for client hello in handshake settings
tomato42 Aug 11, 2017
750f155
save received session tickets after handshake
tomato42 Aug 11, 2017
a677251
simple TLS 1.3 client
tomato42 Aug 16, 2017
68fb5cd
Parsing of Hello Retry Request in TLS record layer
tomato42 Aug 16, 2017
a1f9963
TLS 1.3 client handshake with Hello Retry Request
tomato42 Aug 16, 2017
a344a50
do not advertise TLS 1.3 version if TLS 1.2 is maxVersion
tomato42 Aug 29, 2017
ea68bea
Add support for 1-RTT TLS 1.3 handshake on server side
tomato42 Aug 31, 2017
852fa4e
always send key_share, even if no shares present
tomato42 Sep 1, 2017
7b66cb4
Merge pull request #220 from tomato42/tls-1.3-first-part
tomato42 Feb 26, 2018
811d145
Merge pull request #218 from tomato42/pythonic_names
tomato42 Feb 27, 2018
cba6046
Fixes for python 3.7 support
postlund Feb 21, 2018
a493cfd
Merge pull request #221 from tomato42/postlund-py37_fixes
tomato42 Feb 27, 2018
494743f
Fix python2 compatibility issue with X509 DER parsing
Mar 1, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .checkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scripts/**
tests/**
unit_tests/**
39 changes: 39 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
engines:
radon:
enabled: true
config:
threshold: "C"
pep8:
enabled: true
duplication:
enabled: true
exclude_fingerprints:
# duplication in tlslite/utils/codec.py Writer.addTwo() .addFour()
- 2e783666ce368f4223c1e7f5b162e2d9
- 2c398389f33ea2572edefc5370ed49c0
config:
languages:
python:
python_version: 3
mass_threshold: 35
fixme:
enabled: true
config:
strings:
- TODO
- FIXME
- HACK
- BUG
checks:
bug:
enabled: true
markdownlint:
enabled: true
ratings:
paths:
- "tlslite/**"
- "**.py"
exclude_paths:
- "tests/**/*"
- "scripts/**/*"
- "unit_tests/**/*"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
.pydevproject
.settings
.coverage
.hypothesis
coverage.xml
pylint_report.txt
build/
docs/
docs/_build/
htmlcov/
16 changes: 16 additions & 0 deletions .landscape.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
doc-warnings: true

test-warnings: false

strictness: medium

max-line-length: 80

ignore-paths:
- tests
- unit_tests
- scripts

pep257:
disable:
- D203
3 changes: 3 additions & 0 deletions .pep257
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pep257]

add-ignore = D203
76 changes: 58 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
language: python

# whitelist branches on which tests will be run
branches:
only:
- master
- tlslite-ng-0.5
- tlslite-ng-0.6
- tlslite-ng-0.7

addons:
apt_packages:
# needed for M2Crypto
Expand All @@ -13,6 +21,9 @@ python:
- 3.2
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7-dev

env:
- TACKPY=true
Expand All @@ -28,19 +39,40 @@ matrix:
env: TACKPY=true
- python: 2.7
env: M2CRYPTO=true
# no M2crypto on Python 3
- python: 3.4
env: M2CRYPTO=true
- python: 3.5
env: M2CRYPTO=true
- python: 3.6
env: M2CRYPTO=true
- python: 2.7
env: PYCRYPTO=true
- python: 3.4
env: PYCRYPTO=true
- python: 3.5
env: PYCRYPTO=true
- python: 3.6
env: PYCRYPTO=true
- python: 3.7-dev
env: PYCRYPTO=true
- python: 2.7
env: GMPY=true
- python: 3.4
env: GMPY=true
- python: 3.5
env: GMPY=true
- python: 3.6
env: GMPY=true
- python: 2.7
env: M2CRYPTO=true PYCRYPTO=true GMPY=true
- python: 3.4
env: PYCRYPTO=true GMPY=true
env: M2CRYPTO=true PYCRYPTO=true GMPY=true
- python: 3.5
env: M2CRYPTO=true PYCRYPTO=true GMPY=true
- python: 3.6
env: M2CRYPTO=true PYCRYPTO=true GMPY=true
- python: 3.7-dev
env: M2CRYPTO=true PYCRYPTO=true GMPY=true

before_install:
- |
Expand All @@ -57,15 +89,20 @@ before_install:
PR_FIRST=$(curl --silent --show-error --location $URL | head -1 | grep -o -E '\b[0-9a-f]{40}\b' | tr -d '\n')
TRAVIS_COMMIT_RANGE=$PR_FIRST^..$TRAVIS_COMMIT
fi
# sanity check current commit
- git rev-parse HEAD
- echo "TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE"
- git fetch origin master:refs/remotes/origin/master

install:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then travis_retry pip install unittest2; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then travis_retry pip install unittest2 'isort<4.3'; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then travis_retry pip install unittest2; fi
- if [[ $TACKPY == 'true' ]]; then travis_retry pip install tackpy; fi
- if [[ $M2CRYPTO == 'true' ]]; then travis_retry pip install M2Crypto; fi
- if [[ $M2CRYPTO == 'true' ]]; then travis_retry pip install --pre m2crypto; fi
- if [[ $PYCRYPTO == 'true' ]]; then travis_retry pip install pycrypto; fi
- if [[ $GMPY == 'true' ]]; then travis_retry pip install gmpy; fi
- if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then travis_retry pip install 'coverage<4' 'hypothesis<1.10'; elif [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then travis_retry pip install 'coverage' 'hypothesis<3.44' ; elif [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then travis_retry pip install coverage 'hypothesis<3'; else travis_retry pip install coverage hypothesis; fi
- travis_retry pip install -r requirements.txt
- travis_retry pip install -r build-requirements.txt

script:
Expand All @@ -84,20 +121,23 @@ script:
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" tlslite > pylint_report.txt || :
diff-quality --violations=pylint --fail-under=90 pylint_report.txt
fi
- echo "Will test commits between $TRAVIS_COMMIT_RANGE:"
- git log --oneline --reverse $TRAVIS_COMMIT_RANGE
- |
for i in $(git log --pretty=format:%H --reverse $TRAVIS_COMMIT_RANGE); do
git checkout $i
make clean
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then
unit2 discover || exit 1
else
python -m unittest discover || exit 1
fi
make test-local || exit 1
cd $TRAVIS_BUILD_DIR
done
- |
if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then
echo "Will test commits between $TRAVIS_COMMIT_RANGE:"
git log --oneline --reverse $TRAVIS_COMMIT_RANGE

for i in $(git log --pretty=format:%H --reverse $TRAVIS_COMMIT_RANGE); do
git checkout $i
make clean
if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then
unit2 discover || exit 1
else
python -m unittest discover || exit 1
fi
make test-local || exit 1
cd $TRAVIS_BUILD_DIR
done
fi

sudo: false

Expand Down
134 changes: 134 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# How to contribute

## How to prepare

* You need a [GitHub account](https://github.com/signup/free)
* Submit an [issue ticket](https://github.com/tomato42/tlslite-ng/issues) for
your issue if there is none yet.
* Describe the issue and include steps to reproduce if it's a bug, mention
the earliest version that you know is affected and the version you're using.
* Describe the enhancement and your general ideas on how to implement it
if you want to add new feature or extend existing one. This is not
necessary if the change is small.
* If you are able and want to fix the issue, fork the repository on GitHub

## Technical requirements

To be able to work on the code you will need few pieces of software installed.
The most important is `python` interpreter. Some development dependencies have
additional restrictions on the versions used, so I recommend Python 2.7 or
Python 3.4 as the lowest versions (see .travis.yml if you want details).
Git client, make, text editor and ability to
install local python packages (ability to run pip).

The list goes as follows:

* python (2.7 or 3.4)
* git
* GNU make
* pip
* sphinx

The python module dependencies are as follows:

* unittest (unittest2 on Python 2; should be part of Python 3 install)
* mock (should be part of Python 3 distribution of unittest)
* ecdsa
* pylint
* diff_cover
* coverage
* hypothesis
* enum34 (for Python2, in case of new hypothesis package)

On Fedora they can be installed using:

```
dnf install python-ecdsa python3-ecdsa pylint python3-pylint python-diff-cover \
python3-diff-cover python-coverage python3-coverage python2-hypothesis \
python3-hypothesis python3-libs python-unittest2 python-mock python3-sphinx
```

On RHEL 7 you will need to enable [EPEL](https://fedoraproject.org/wiki/EPEL),
and install [pip](https://pip.pypa.io/en/stable/installing/) for Python3,
after which you can install the dependencies using:

```
yum install python-ecdsa python34-ecdsa pylint \
python-coverage python34-coverage python2-hypothesis \
python34-libs python-unittest2 python-mock python-pip python-sphinx
pip2 install diff-cover
pip3 install hypothesis diff-cover pylint
```

Optional module dependencies:

* tackpy
* m2crypto
* pycrypto
* gmpy

On Fedora they can be installed using:

```
pip install tackpy
dnf install m2crypto python-crypto python3-crypto python-gmpy2 python3-gmpy2
```

## Make changes

* In your forked repository, create a topic branch for your upcoming patch
(e.g. 'implement-aria' or 'bugfix-osx-crash')
* usually this is based on the master branch
* to create branch based on master: `git branch <example-name>` then
checkout the branch `git checkout <example-name>`. For your own convinience
avoid working directly on the `master` branch.
* Make sure you stick to the coding style that is used in surrounding code
* you can use `pylint --msg-template="{path}:{line}: [{msg_id}({symbol}),
{obj}] {msg}" tlslite > pylint_report.txt; diff-quality --violations=pylint
pylint_report.txt` to see if your changes do not violate the general
guidelines (alternatively you can just run `make test-dev` as described
below).
* Make commits of logical units and describe them properly in commits
* When creating a comment, keep the first line short and separate it from
the rest by whiteline
* See also [OpenStack guide](https://wiki.openstack.org/wiki/GitCommitMessages)
for general good ideas about git commit messages
* Check for unnecessary whitespace with `git diff --check` before committing

* Generally newly submitted code should have test coverage so that it can
be clearly shown that it works correctly.
* pull requests with code refactoring of code that does not have test
coverage should have test coverage of the code added first
* Assure nothing is broken by running all tests using `make test-dev`
* Pull requests that fail the last check of the `test-dev` target,
the test coverage check, may still be accepted, but making pull request
that passes it is the best way to make the review quick.

## Submit changes

* Push your changes to a topic branch in your fork of the repository.
* Open a pull request to the original repository and choose the right original
branch you want to patch (that usually will be tomato42/master).
* If you posted issues previously, make sure you reference them in the opening
commit of the pull request (e.g. 'fixes #12'). But _please do not close the
issue yourself_. GitHub will do that automatically once the issue is merged.
* Wait for checks to pass. Travis-ci check is mandatory, pull requests which
fail it will not be merged. Landscape and coveralls failures are not blocking
but may require explanation. Going to codeclimate and quantified code
(see README.md for links) and checking the branch and pull request is also
a good idea.
* if you are not sure if the pull will pass the checks it is OK to submit
a test pull request, but please mark it as such ('[WIP]' in title is
enough)
* Once you recieve feedback from reviewers or from the automated systems,
modify your local patches (that usually means that you need to prepare
"fixup" patches or interactively
[rebase](https://help.github.com/articles/about-git-rebase/)) and push
updated branch to github (that usually will require to perform a
[force push](http://movingfast.io/articles/git-force-pushing/))
* Wait again for review or automated checks.

## Additional Resources

* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
Loading