<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod/modussl_mbedtls.c, branch azure</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=azure</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=azure'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2018-06-18T02:35:56+00:00</updated>
<entry>
<title>extmod: Update to use new mp_get_stream helper.</title>
<updated>2018-06-18T02:35:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-06-13T02:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e8398a58567cc94b866d46721fd06289601f5c8a'/>
<id>urn:sha1:e8398a58567cc94b866d46721fd06289601f5c8a</id>
<content type='text'>
With this patch objects are only checked that they have the stream protocol
at the start of their use as a stream, and afterwards the efficient
mp_get_stream() helper is used to extract the stream protocol C methods.
</content>
</entry>
<entry>
<title>extmod/modussl_mbedtls: Use mbedtls_entropy_func for CTR-DRBG entropy.</title>
<updated>2018-05-31T11:52:29+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-31T11:52:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ea22406f7661edcce88defb9d20517ec967a5a9f'/>
<id>urn:sha1:ea22406f7661edcce88defb9d20517ec967a5a9f</id>
<content type='text'>
If mbedtls_ctr_drbg_seed() is available in the mbedtls bulid then so should
be mbedtls_entropy_func().  Then it's up to the port to configure a valid
entropy source, eg via MBEDTLS_ENTROPY_HARDWARE_ALT.
</content>
</entry>
<entry>
<title>extmod/modussl_mbedtls: Populate sock member right away in wrap_socket.</title>
<updated>2018-05-31T11:47:26+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-31T11:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=98b9f0fc9d0fe14c5f13faf2e9b902422919594c'/>
<id>urn:sha1:98b9f0fc9d0fe14c5f13faf2e9b902422919594c</id>
<content type='text'>
Otherwise the "sock" member may have an undefined value if wrap_socket
fails with an exception and exits early, and then if the finaliser runs it
will try to close an invalid stream object.

Fixes issue #3828.
</content>
</entry>
<entry>
<title>py/stream: Switch stream close operation from method to ioctl.</title>
<updated>2018-04-10T03:41:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-03-07T06:48:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cf31d384f1d2ca09f817f154892eaa6860c10144'/>
<id>urn:sha1:cf31d384f1d2ca09f817f154892eaa6860c10144</id>
<content type='text'>
This patch moves the implementation of stream closure from a dedicated
method to the ioctl of the stream protocol, for each type that implements
closing.  The benefits of this are:

1. Rounds out the stream ioctl function, which already includes flush,
   seek and poll (among other things).

2. Makes calling mp_stream_close() on an object slightly more efficient
   because it now no longer needs to lookup the close method and call it,
   rather it just delegates straight to the ioctl function (if it exists).

3. Reduces code size and allows future types that implement the stream
   protocol to be smaller because they don't need a dedicated close method.

Code size reduction is around 200 bytes smaller for x86 archs and around
30 bytes smaller for the bare-metal archs.
</content>
</entry>
<entry>
<title>extmod/modussl_mbedtls: Clean up mbedtls state when error during setup.</title>
<updated>2017-12-13T03:48:53+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-31T04:54:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7df2ebbfeaf390cc257c56916c5af94c7785469f'/>
<id>urn:sha1:7df2ebbfeaf390cc257c56916c5af94c7785469f</id>
<content type='text'>
Without this patch, if the SSL handshake fails (eg the connection was lost)
then the mbedtls state (memory) will never be freed.
</content>
</entry>
<entry>
<title>extmod/modussl_mbedtls: Allow to compile with unix coverage build.</title>
<updated>2017-10-30T04:41:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-30T04:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=10b76a9620b7407ffed8366d71f5463496f98838'/>
<id>urn:sha1:10b76a9620b7407ffed8366d71f5463496f98838</id>
<content type='text'>
Fixes a few C warnings.  No functional changes.
</content>
</entry>
<entry>
<title>extmod/modussl: Add finaliser support for ussl objects.</title>
<updated>2017-10-30T04:25:32+00:00</updated>
<author>
<name>Eric Poulsen</name>
<email>eric@zyxod.com</email>
</author>
<published>2017-10-27T04:17:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=74ec52d85758ad9da7a3abb24257511b22d74964'/>
<id>urn:sha1:74ec52d85758ad9da7a3abb24257511b22d74964</id>
<content type='text'>
Per the comment found here
https://github.com/micropython/micropython-esp32/issues/209#issuecomment-339855157,
this patch adds finaliser code to prevent memory leaks from ussl objects,
which is especially useful when memory for a ussl context is allocated
outside the uPy heap.  This patch is in-line with the finaliser code found
in many modsocket implementations for various ports.

This feature is configured via MICROPY_PY_USSL_FINALISER and is disabled by
default because there may be issues using it when the ussl state *is*
allocated on the uPy heap, rather than externally.
</content>
</entry>
<entry>
<title>all: Remove inclusion of internal py header files.</title>
<updated>2017-10-04T01:37:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-04T01:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a3dc1b1957d2c96d7c60c2c629c95077b03488a1'/>
<id>urn:sha1:a3dc1b1957d2c96d7c60c2c629c95077b03488a1</id>
<content type='text'>
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
</content>
</entry>
<entry>
<title>extmod/modussl_mbedtls: Allow to compile with MBEDTLS_DEBUG_C disabled.</title>
<updated>2017-09-06T07:34:45+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-09-06T07:34:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=beeb7483d889f5880895ecdd8e7a354f16956037'/>
<id>urn:sha1:beeb7483d889f5880895ecdd8e7a354f16956037</id>
<content type='text'>
With MBEDTLS_DEBUG_C disabled the function mbedtls_debug_set_threshold()
doesn't exist.  There's also no need to call mbedtls_ssl_conf_dbg() so a
few bytes can be saved on disabling that and not needing the mbedtls_debug
callback.
</content>
</entry>
<entry>
<title>extmod/modussl_mbedtls.c: Add ussl.getpeercert() method.</title>
<updated>2017-08-16T05:01:00+00:00</updated>
<author>
<name>Eric Poulsen</name>
<email>eric@zyxod.com</email>
</author>
<published>2017-08-15T14:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d5191edf7ff81f5f07243cb2a318508c1e9cc5df'/>
<id>urn:sha1:d5191edf7ff81f5f07243cb2a318508c1e9cc5df</id>
<content type='text'>
Behaviour is as per CPython but only the binary form is implemented here.
A test is included.
</content>
</entry>
</feed>
