Commit Graph

46 Commits

Author SHA1 Message Date
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 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
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 5f6cf282b1 fixes include.am comments 2016-11-07 21:15:23 -03:00
Moisés Guimarães 88df983251 moves include.am into wolfcrypt-py folder 2016-11-07 21:09:08 -03:00
Moisés Guimarães b50914f2c7 Drops 3DES and adds int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng); for RSA blinding 2016-11-07 16:06:35 -03:00
Moisés Guimarães 08f6d23e84 moves wolfcrypt-py implementation to wrapper/python/wolfcrypt 2016-11-07 16:02:41 -03:00
Jacob Barthelmeh 1ed06b53df C# Wrapper : TCP check connection termination 2016-09-28 15:00:30 -06:00
Moisés Guimarães 7f71c526f6 adds python3 support 2016-06-03 10:37:41 -03:00
Moisés Guimarães 6736ffe10e adds links to wolfssl.com 2016-06-02 22:08:57 -03:00
Moisés Guimarães a76291c2e2 adds tox instructions 2016-06-02 21:38:34 -03:00
Moisés Guimarães 07ce928bf3 adds installation testing with vagrant 2016-05-23 21:10:44 -03:00
Moisés Guimarães 04d5ca41df adds --enable-Sha512 to make sure it is always present 2016-05-23 20:33:11 -03:00
Moisés Guimarães fcc0eb7a6a fixes install instructions 2016-05-20 03:55:57 -03:00
Moisés Guimarães 47a1dd8cc4 fixes install steps 2016-05-17 14:15:17 -03:00
Moisés Guimarães a000ee4db3 remove empty dirs 2016-05-16 22:17:09 -03:00
Moisés Guimarães dc080694b4 reorder installation steps 2016-05-16 21:55:31 -03:00
Moisés Guimarães 2851f7d6a1 remove unnecessary dependency 2016-05-16 20:37:42 -03:00
Moisés Guimarães 2a0adc74a0 fixes wrapper path 2016-05-16 20:13:26 -03:00
Moisés Guimarães 347d80e879 removes folders from include.am 2016-05-16 15:49:32 -03:00
Moisés Guimarães 40cf30a13d adds .gitignore to include.am 2016-05-16 15:31:51 -03:00
Moisés Guimarães d76d74d6c5 updates Linux deps on README 2016-05-15 15:08:16 -03:00
Moisés Guimarães 9659505260 updates python docs 2016-05-09 18:46:01 -03:00
Moisés Guimarães 412141198e drops 'import about' requirement 2016-05-09 15:25:18 -03:00
Moisés Guimarães b0c23ceafa fixes about 2016-05-05 12:48:47 -03:00
Moisés Guimarães 9e9fd24d68 updates metadata; drops py26 tests 2016-05-04 21:38:27 -03:00
Moisés Guimarães 3181731404 adds docs 2016-05-03 00:49:56 -03:00
Moisés Guimarães 69ac477976 updates docs template 2016-04-29 16:25:53 -03:00
Moisés Guimarães 1efd1343ee initial docs 2016-04-29 16:13:38 -03:00
Moisés Guimarães 66d41eee36 updates python README 2016-04-28 13:36:41 -03:00
Moisés Guimarães d8309ab624 adds python ignored files 2016-04-28 13:26:59 -03:00
Moisés Guimarães 7e661ab866 importing wolfcrypt-py repo 2016-04-28 13:20:10 -03:00
Jacob Barthelmeh e99a5b0483 prepare for release v3.9.0 2016-03-17 16:02:13 -06:00
David Garske cb3a9cc348 Removed the execute bit on all .c, .h, and .cs files. 2016-02-08 09:45:31 -08:00
Jacob Barthelmeh 5e0fa1de90 utf8 switched to default and added comments 2016-01-08 16:50:49 -07:00
Jacob Barthelmeh ee1a767332 account for null terminator 2016-01-07 17:39:00 -07:00
Jacob Barthelmeh 1600ba7f3d example IO callback and keep memory alive when needed 2015-12-06 14:30:00 -07:00
Jacob Barthelmeh d673a56c83 change line ending of license to match Windows CR LF 2015-12-01 14:49:16 -07:00
Jacob Barthelmeh 7d13fe9017 license heading 2015-11-20 10:19:55 -07:00
Jacob Barthelmeh 39d6992759 logging levels added 2015-11-20 09:59:08 -07:00
Jacob Barthelmeh b9dae51658 C Sharp wrapper 2015-11-19 20:51:32 -07:00