summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.c
diff options
context:
space:
mode:
authorPeter Züger <zueger.peter@icloud.com>2024-04-26 17:48:57 +0200
committerDamien George <damien@micropython.org>2024-08-13 17:32:32 +1000
commit4d6d84983f370e48e81fb05fe31802e0a13fb369 (patch)
tree527155d941758cb5366b90565e6e508437ecddb5 /py/obj.c
parent288a03625327b025f81bb6d4e7fb76d56343172c (diff)
downloadmicropython-4d6d84983f370e48e81fb05fe31802e0a13fb369.tar.gz
micropython-4d6d84983f370e48e81fb05fe31802e0a13fb369.zip
extmod/modtls_mbedtls: Fix DER parsing and calculation of key/cert len.
`mbedtls_pk_parse_key()` expects `key_len` to include the NULL terminator for PEM data but not for DER encoded data. This also applies to `mbedtls_x509_crt_parse()` and `cert_len`. Since all PEM data contains "-----BEGIN" this is used to check if the data is PEM (as per mbedtls code). This can be done for both v2 and v3 of mbedtls since the fundamental behaviour/expectation did not change. What changed is that in v3 the PKCS#8 DER parser now checks that the passed key buffer is fully utilized and no bytes are remaining (all other DER formats still do not check this). Signed-off-by: Peter Züger <zueger.peter@icloud.com>
Diffstat (limited to 'py/obj.c')
0 files changed, 0 insertions, 0 deletions