Commit Graph

94 Commits

Author SHA1 Message Date
Chris Conlon 667b8431cc Merge pull request #683 from moisesguimaraes/wolfssl-py
wolfssl python wrapper
2017-07-19 09:22:02 -07:00
Moisés Guimarães c93a903cae atualiza lista de arquivos incluídos na versão de distribuição. 2017-07-18 11:36:07 -03:00
Moisés Guimarães 1729e0205f reads _CADATA from file 2017-07-03 12:39:42 -03:00
Moisés Guimarães 54177c14b4 imports certs from ./certs 2017-07-03 12:31:47 -03:00
Moisés Guimarães bba3fcf772 removes certs 2017-07-03 12:22:22 -03:00
Chris Conlon 042ee817f3 Merge pull request #757 from moisesguimaraes/updates-wolfcrypt-py-docs
Removes 3DES from the wolfCrypt Python docs
2017-06-13 10:55:21 -06:00
Moisés Guimarães 7a52b5b394 fixes makefiles and requiremets 2017-05-29 20:44:28 -03:00
Moisés Guimarães 38c6d2e3eb Merge pull request #737 from embray/patch-1
wolfcrypt Python: work around minor issue in Random.__del__
2017-05-29 20:19:21 -03:00
JacobBarthelmeh 52215b3ecf Merge pull request #734 from kaleb-himes/csharp-addition
Adds wrapper for CTX_load_verify_locations to C# wrapper
2017-03-17 18:18:17 -06:00
Moisés Guimarães daafb2c5ac changes docs to single page 2017-02-05 18:56:19 -03:00
Moisés Guimarães e33d4c0172 adds full docs 2017-02-05 18:51:13 -03:00
Moisés Guimarães 00a74d0da4 adds initial doc files 2017-02-05 16:43:43 -03:00
Erik Bray bf12e4ecca wolfcrypt Python: work around minor issue in Random.__del__
During interpreter shutdown, depending on the order in which things happen, a module can be unloaded before all instances of classes defined in that module are garbage collected.

In particular, this means that any global variables (including imported modules) become `None` by the time the instances `__del__` is called, resulting in
```
AttributeError: 'NoneType' object has no attribute 'wc_FreeRng'
```
being displayed while the process exits.  This can be avoided simply by catching and ignoring the `AttributeError` in this case, since the process is shutting down anyways.
2017-02-02 16:51:41 +01:00
kaleb-himes d1f323ca58 Adds wrapper for CTX_load_verify_locations to C# wrapper 2017-01-31 14:45:33 -07:00
Erik Bray a094a36fa8 Update random.py
Realized that `ffi.string()` could truncate the output on null bytes.
2017-01-28 15:55:42 +01:00
Erik Bray e96a720f04 Fixes a serious bug in Random.byte
Python's bytecode compiler has a peephole optimizer which, among other things, can recognize constant expressions and replace them with a constant.

In `Random.byte` the expression `t2b('\0')` is recognized as a constant and is replaced with a single constant compiled into the function's bytecode.

This means that every time you run `Random.byte`, rather than creating a new `str` object (or `bytes` in Python 3) it's reusing the same one each time, and `wc_RNG_GenerateByte` is writing right into that constant object's buffer; hence the following behavior:

```
In [55]: rng = Random()

In [56]: a = rng.byte()

In [57]: a
Out[57]: "'"

In [58]: rng.byte()
Out[58]: '\x11'

In [59]: a
Out[59]: '\x11'

In [60]: rng.byte()
Out[60]: '\x16'

In [61]: a
Out[61]: '\x16'

In [62]: rng.byte.__func__.__code__.co_consts
Out[62]:
('\n        Generate and return a random byte.\n        ',
 '\x16',
 0,
 'RNG generate byte error (%d)')

In [63]: rng.byte()
Out[63]: '\xad'

In [64]: rng.byte.__func__.__code__.co_consts
Out[64]:
('\n        Generate and return a random byte.\n        ',
 '\xad',
 0,
 'RNG generate byte error (%d)')
```

`Random.bytes` does not necessarily have this problem since its result buffer is not a constant expression, though I feel like it could also in principle be affected if the string were interned (though I couldn't produce such a result). Nevertheless, it doesn't seem like a good idea to be updating `str` objects' buffers directly.
2017-01-26 20:48:15 +01:00
Moisés Guimarães d3d7446a24 removes 3DES from docs 2017-01-21 15:31:26 -02:00
Moisés Guimarães a761a7fc64 updates provisioners 2017-01-18 19:19:03 -02:00
Moisés Guimarães feb6617dc9 updates centos provisioner 2017-01-18 18:41:15 -02:00
Moisés Guimarães 51bf46288b adds client example 2017-01-18 18:18:19 -02:00
Moisés Guimarães 5c8e69eb5e updates vagrant configs; updates server example, updates copyright year. 2017-01-18 17:59:48 -02:00
Moisés Guimarães bb97e03a44 initial server tests 2017-01-16 19:40:46 -02:00
Moisés Guimarães 089387906e updates tests 2017-01-16 18:52:34 -02:00
Moisés Guimarães 715d6afeda updates tox config 2017-01-16 18:48:01 -02:00
Moisés Guimarães 0a9f66338c adds coverity tests 2017-01-15 12:51:09 -02:00
Moisés Guimarães 2d56f09320 adds accept() behavior to SSLSocket; Migrates tests to pytest. 2017-01-15 12:26:22 -02:00
Moisés Guimarães 56091e267f moving source code into src 2017-01-12 19:27:36 -02:00
Moisés Guimarães 53d4c171c8 adds more client tests 2016-12-22 17:58:13 -02:00
Moisés Guimarães 35f03eb00a fixes docs. 2016-12-22 16:59:50 -02:00
Moisés Guimarães 1c9147a41e adds supported curves to context; fixes compatibility issues with py27 2016-12-22 15:01:58 -02:00
Moisés Guimarães 9b58ab0211 renames exceptions file 2016-12-22 15:01:58 -02:00
Moisés Guimarães 4b75d11164 fixes socket calls 2016-12-22 15:01:58 -02:00
Moisés Guimarães f3c1522608 always treat native_object as a pointer 2016-12-22 15:01:58 -02:00
Moisés Guimarães b9934695fb pretest version of SSLSocket 2016-12-22 15:01:58 -02:00
Moisés Guimarães 567dfd76b3 adds initial code for SSLSocket 2016-12-22 15:01:58 -02:00
Moisés Guimarães 2cbdd45e8f adds negotiate() to ssl interface 2016-12-22 15:01:58 -02:00
Moisés Guimarães 07072ef266 moving SSLContext and SSLSocket to __init__ to avoid ciclic includes 2016-12-22 15:01:58 -02:00
Moisés Guimarães baeba53527 adds wrap_socket to the context 2016-12-22 15:01:58 -02:00
Moisés Guimarães 445e375daa adds ssl interface to ffi 2016-12-22 15:01:58 -02:00
Moisés Guimarães 52eb0becf0 adds set_ciphers to context 2016-12-22 15:01:58 -02:00
Moisés Guimarães 368f2baf88 adds verify_mode to context 2016-12-22 15:01:58 -02:00
Moisés Guimarães 8eec3cb874 adds initial code for SSLSocket 2016-12-22 15:01:58 -02:00
Moisés Guimarães 0ed0672b16 fixes pylint warnings 2016-12-22 15:01:58 -02:00
Moisés Guimarães c0b59a585b adds support for buffered ca certificates 2016-12-22 15:01:58 -02:00
Moisés Guimarães 015ffecbab fixes unicode quotes and adds load_cert_chain test. 2016-12-22 15:01:58 -02:00
Moisés Guimarães 760ddd14f5 fixes pylint warnings;
adds more tests to load_verify_locations;
fixes data type when calling C functions;
fixes result verification when calling C functions.
2016-12-22 15:01:58 -02:00
Moisés Guimarães 7201435f2d adds initial context tests. 2016-12-22 15:01:58 -02:00
Moisés Guimarães bd14611879 adds load_verify_locations and load_cert_chain implementations. 2016-12-22 15:01:58 -02:00
Moisés Guimarães c8ae6abb43 adds context functions. 2016-12-22 15:01:58 -02:00
Moisés Guimarães e1c01378c7 fixes ssl version in test to maintain backward compatibility. 2016-12-22 15:01:58 -02:00