Hanno Becker fab3569963 Use in-place decryption in pk_parse_pkcs8_encrypted_der
The stack buffer used to hold the decrypted key in pk_parse_pkcs8_encrypted_der
was statically sized to 2048 bytes, which is not enough for DER encoded 4096bit
RSA keys.

This commit resolves the problem by performing the key-decryption in-place,
circumventing the introduction of another stack or heap copy of the key.

There are two situations where pk_parse_pkcs8_encrypted_der is invoked:
1. When processing a PEM-encoded encrypted key in mbedtls_pk_parse_key.
   This does not need adaption since the PEM context used to hold the decoded
   key is already constructed and owned by mbedtls_pk_parse_key.
2. When processing a DER-encoded encrypted key in mbedtls_pk_parse_key.
   In this case, mbedtls_pk_parse_key calls pk_parse_pkcs8_encrypted_der with
   the buffer provided by the user, which is declared const. The commit
   therefore adds a small code paths making a copy of the keybuffer before
   calling pk_parse_pkcs8_encrypted_der.
2017-08-25 13:57:21 +01:00
..
2017-07-20 12:36:53 +02:00
2017-02-15 09:08:26 +00:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2016-10-13 13:51:09 +01:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00
2017-05-11 21:55:17 +01:00
2015-09-04 14:21:07 +02:00
2017-07-20 12:36:53 +02:00
2017-07-22 11:53:56 +02:00
2015-09-04 14:21:07 +02:00
2015-09-04 14:21:07 +02:00